When you try to open the page everything works normally. Except for some files.
Part of the statics gives with redirecting.
For example, there is a picture
am49.ru/uploads/2016/05/am49.ru.f941d38af67781d48b...
When you try to show it on the page makes a few redirects. In the end, the image url turns out like this
94.247.56.247/94.247.56.247/94.247.56.247/94.247.5...
Part of pictures, with the same way, giving fine without a redirect
am49.ru/uploads/2016/05/am49.ru.f941d38af67781d48b...
From the name/mask of a file name bug does not depend on the same problem with
am49.ru/talk/style_images/ip.boardpr/logo4.jpg
Different images may have different number of redirects somewhere 2, somewhere abuts the limit of the browser.
Config for tests left like this, minimum. Redirect is not lost.
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
index index.html index.htm index.php;
default_type application/octet-stream;
"log_format" main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'$upstream_cache_status';
access_log /var/log/nginx/access.log main;
sendfile on;
timeout 300s;
types_hash_max_size 2048;
server_tokens off;
server {
listen 80 default_server;
server_name am49.ru;
location / {
"proxy_redirect" off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
client_max_body_size 328M;
client_body_buffer_size 328k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_set_header Host 'am49.ru';
proxy_pass http://127.0.0.1:8080;
}
location ~* \.(gif|jpg|jpeg|png|bmp|mp4|flv)$ {
root /home/auto.magadan.EN/html/;
access_log off;
expires max;
add_header Last-Modified "";
try_files $uri $uri/ =404;
}
}
}
The mime file.standard types, the one with the installation of nginx did. Not changed.
nginx version: nginx/1.6.3
With nginx -V watched as the config is the only file. And edit it. Other not connect.
In what direction to dig?
in access log of Apache static at all. It turns out, the second location is triggered, and gives it to nginx.
>to include a second location in the first
tried. it did not help.
>vklchit debug logging and see the path
log included - Zoie.OReilly43 commented on July 9th 19 at 10:47
the headers of the images obtained after the redirect, written in nginx
https://www.dropbox.com/s/cuk4j6iqr2u5cc6/%D0%A1%D... - Zoie.OReilly43 commented on July 9th 19 at 10:59
Show end the config with debug - giovanna.DuBuque commented on July 9th 19 at 11:02
https://gist.github.com/Dimasmagadan/622830c224cb7...
Leave for minimum of tests is not able to users go. - Zoie.OReilly43 commented on July 9th 19 at 11:05
>have to get any request
understand why don't see, trying to understand
put a debug to your ip, look at all the logs
>why do you call the picture on the ip?
for pictures turn your domain name
so
am49.ru/uploads/2016/05/am49.ru.f941d38af67781d48b...
but somehow throws in the ip domain.
where does this redirect and want to find out - Zoie.OReilly43 commented on July 9th 19 at 11:14
location / {}
location /uploads {} - Zoie.OReilly43 commented on July 9th 19 at 11:20
that is, did two location which should work on statics
one with the regular season, the other without.
checked first with the regular season - Zoie.OReilly43 commented on July 9th 19 at 11:23
location ~* .gif$ {}
location /upload/a.gif {}
Will fulfill the second rule, despite the fact that it is late.
describe why it works as you write. - giovanna.DuBuque commented on July 9th 19 at 11:26
now fixed.
thanks for the tips. - Zoie.OReilly43 commented on July 9th 19 at 11:29