Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # веста панель с nginx и apache.
- server {
- listen 127.0.0.1:80;
- server_name youimgsite.com www.youimgsite.com;
- error_log /var/log/httpd/domains/youimgsite.com.error.log error;
- # начало важных настроек:
- location / {
- proxy_pass http://127.0.0.1:8080;
- }
- # нужно наличие модуля: with-http_image_filter_module
- # большая ютуб картинка:
- location ~ ^/images/([0-9a-zA-Z\-\_]+)\.jpeg {
- resolver 8.8.8.8;
- proxy_pass https://i.ytimg.com/vi/$1/maxresdefault.jpg;
- proxy_intercept_errors on;
- error_page 404 @tosmall;
- proxy_read_timeout 3;
- proxy_set_header Host i.ytimg.com;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header realip $remote_addr;
- # image_filter test;
- # image_filter_buffer 1M;
- # image_filter_jpeg_quality 85;
- expires 1y;
- add_header Cache-Control "public";
- }
- # если нету большой - редирект на маленькую:
- location @tosmall {
- rewrite ^/images/(.*).jpeg$ /thumbs/$1.jpeg permanent;
- }
- # маленькая ютуб картинка:
- location ~ ^/thumbs/([0-9a-zA-Z\-\_]+)\.jpeg {
- resolver 8.8.8.8;
- proxy_pass https://i.ytimg.com/vi/$1/hqdefault.jpg;
- proxy_read_timeout 3;
- proxy_set_header Host i.ytimg.com;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header realip $remote_addr;
- # image_filter test;
- # image_filter_buffer 1M;
- # image_filter_jpeg_quality 85;
- expires 1y;
- add_header Cache-Control "public";
- }
- # конец важных настроек.
- location ~ /\.ht {return 404;}
- location ~ /\.svn/ {return 404;}
- location ~ /\.git/ {return 404;}
- location ~ /\.hg/ {return 404;}
- location ~ /\.bzr/ {return 404;}
- include /home/admin/conf/web/nginx.youimgsite.com.conf*;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement