diff --git a/proxy/nginx.conf b/proxy/nginx.conf index a8f5cc6..afcf293 100644 --- a/proxy/nginx.conf +++ b/proxy/nginx.conf @@ -54,21 +54,23 @@ http { return 301 login.pl; } - # JS & CSS - location ~* \.(js|css)$ { - add_header Pragma "public"; - add_header Cache-Control "public, must-revalidate, proxy-revalidate"; # Production - expires 7d; # Indicate that the resource can be cached for 1 week # Production - try_files $uri =404; + location / { + try_files $uri @strippedprefix @starman; } - location / { + location @strippedprefix { + rewrite ^/([a-z0-9A-Z]+)/(.*) /$2 break; + } + + location @starman { + proxy_pass http://127.0.0.1:5762; + proxy_read_timeout 300; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Proto $scheme; - proxy_read_timeout 300; - proxy_pass http://127.0.0.1:5762; } } }