Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name images4.gameru.net;
- return 301 https://$server_name$request_uri;
- }
- server {
- listen 443;
- server_name images4.gameru.net;
- root /home/1001v/web/images;
- location / {
- location ~/thumb/(?<ch1>\w)(?<ch2>\w)(?<ch3>\w+).(?<ch4>\w+) {
- root /home/1001v/web/api/images;
- try_files /$ch1/$ch2/th_$ch1$ch2$ch3.$ch4 @404;
- }
- location ~/image/thumb/(?<ch1>\w)/(?<ch2>\w)(?<ch3>\w)(?<ch4>\w+).(?<ch5>\w+) {
- root /home/1001v/web/api/images;
- try_files /$ch2/$ch3/th_${ch1}_$ch2$ch3$ch4.$ch5 @generate;
- }
- location ~/image/direct/(?<ch1>\w)(?<ch2>\w)(?<ch3>\w+).(?<ch4>\w+) {
- proxy_pass http://localhost:5555;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_cache_bypass $http_upgrade;
- error_page 502 = @502;
- }
- gzip_static on;
- try_files $uri $uri/index.html @rewrites;
- }
- location @generate {
- proxy_pass http://localhost:5555;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_cache_bypass $http_upgrade;
- error_page 502 = @404;
- }
- location @rewrites {
- rewrite ^(.+)$ /index.html last;
- }
- location @502 {
- root /home/1001v/web/api/images;
- try_files /$ch1/$ch2/$ch1$ch2$ch3.$ch4 @404;
- }
- location @404 {
- root /home/1001v/web/api/resources/images;
- try_files /404.jpg =404;
- }
- location @500 {
- root /home/1001v/web/api/resources/images;
- try_files /503.jpg =500;
- }
- location /error/ {
- alias /home/1001v/web/document_errors/;
- }
- location ~ /\.ht {
- return 404
- }
- location ~ /\.svn/ {
- return 404
- }
- location ~ /\.git/ {
- return 404
- }
- location ~ /\.hg/ {
- return 404
- }
- location ~ /\.bzr/ {
- return 404
- }
- ssl_certificate /etc/letsencrypt/live/images4.gameru.net/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/images4.gameru.net/privkey.pem; # managed by Certbot
- }
- server {
- listen 80;
- server_name api.gameru.net;
- return 301 https://$server_name$request_uri;
- }
- server {
- listen 443;
- server_name api.gameru.net;
- location / {
- proxy_pass http://localhost:5555;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_cache_bypass $http_upgrade;
- }
- ssl_certificate /etc/letsencrypt/live/api.gameru.net/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/api.gameru.net/privkey.pem; # managed by Certbot
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement