From ab54b538b020e8b9b90161909fd58ff420751795 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Tue, 12 Nov 2024 00:08:35 +0100 Subject: [PATCH] Update nginx.conf --- perl/nginx.conf | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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; }