diff --git a/perl/nginx.conf b/perl/nginx.conf index aa6694c..079c779 100644 --- a/perl/nginx.conf +++ b/perl/nginx.conf @@ -36,19 +36,22 @@ http { root /home/circleci/project/UI; - location ~ /js/(.*) { - try_files /js/$1 /js-src/$1 =404; + # 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; + if (!-f $request_filename) { + rewrite ^/([a-z0-9A-Z]+)/(.*) /$2 break; + } } - location /setup { - proxy_pass http://localhost:5762; + location = / { + return 301 /login.pl } - - location /erp/api { - proxy_pass http://localhost:5762; - } - - location ~ \.pl$ { + + location / { proxy_pass http://localhost:5762; }