From b1477c8634a9907878208e079eef2fa1492b3076 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sun, 11 Jan 2026 02:12:25 +0100 Subject: [PATCH] fix(nginx): update configs for ssl reverse proxy severs --- nginx/sites-available/44300.conf | 38 +++++++------------------------- nginx/sites-available/44301.conf | 37 ++++--------------------------- nginx/sites-available/44302.conf | 32 +++++---------------------- nginx/sites-available/44303.conf | 16 ++++++++++++++ 4 files changed, 33 insertions(+), 90 deletions(-) create mode 100644 nginx/sites-available/44303.conf diff --git a/nginx/sites-available/44300.conf b/nginx/sites-available/44300.conf index 318730b..7bd775a 100644 --- a/nginx/sites-available/44300.conf +++ b/nginx/sites-available/44300.conf @@ -1,39 +1,17 @@ server { - listen 44300 ssl http2; + listen 44300 ssl; server_name _; - include snippets/vlw.se-ssl.conf; - root /var/www; - index index.html index.php; - - client_max_body_size 1G; - - add_header Access-Control-Allow-Origin *; + include snippets/vlw.se-ssl; location / { - try_files $uri $uri.html $uri/ @extensionless-php; - autoindex on; - } + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + proxy_set_header Accept-Encoding gzip; + proxy_set_header X-Forwarded-For $remote_addr; - location ~ \.php$ { - include snippets/fastcgi-php.conf; - # With php-fpm (or other unix sockets): - fastcgi_pass unix:/run/php/php8.4-fpm.sock; - # With php-cgi (or other tcp sockets): - #fastcgi_pass 127.0.0.1:9000; - } - - location @extensionless-php { - rewrite ^(.*)$ $1.php last; - } - - # -- Proxies -- - - # -- Overrides -- - - location /tools/pla/index.php { - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/run/php/php7.3-fpm.sock; + proxy_pass http://localhost:8000; } } diff --git a/nginx/sites-available/44301.conf b/nginx/sites-available/44301.conf index 186a481..349d3d7 100644 --- a/nginx/sites-available/44301.conf +++ b/nginx/sites-available/44301.conf @@ -3,38 +3,9 @@ server { server_name _; - include snippets/vlw.se-ssl.conf; + include snippets/vlw.se-ssl; - # Reflect - #root /var/www/reflect/public; - - # Vegvisir - root /var/www/fw/vegvisir/public; - - # Other - #root /var/www/sites/href/public; - - index index.html index.php; - -# location ~ /assets/* { -# root /var/www/sites/vlw.se/public; -# root /var/www/vegvisir-website/public; - -# root /var/www/icellate-web; -# root /var/www/genemate-2/public; -# root /var/www/lams; -# root /var/www/violet; - -# try_files $uri $uri/ =404; -# add_header Access-Control-Allow-Origin *; -# } - - location ~ /* { - try_files /index.php =503; - add_header Access-Control-Allow-Origin *; - - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/run/php/php8.4-fpm.sock; - #fastcgi_pass unix:/run/php/php7.3-fpm.sock; - } + location / { + proxy_pass http://localhost:8001; + } } diff --git a/nginx/sites-available/44302.conf b/nginx/sites-available/44302.conf index bff657c..6041fa9 100644 --- a/nginx/sites-available/44302.conf +++ b/nginx/sites-available/44302.conf @@ -1,33 +1,11 @@ server { - listen 44302 ssl http2; + listen 44302 ssl; server_name _; - include snippets/vlw.se-ssl.conf; + include snippets/vlw.se-ssl; - # Reflect - root /var/www/fw/reflect/public; - # iCellate API peer helper -# root /var/www/api-peer-wrapper/public; - # Vegvisir -# root /var/www/vegvisir/public; - - index index.html index.php; - -# location ~ /assets/* { -# try_files $uri $uri/ =404; -# add_header Access-Control-Allow-Origin *; -# } - - location ~ /* { - try_files /index.php =503; - - add_header Access-Control-Allow-Origin $http_origin always; - add_header Access-Control-Allow-Methods GET,POST,PUT,PATCH,DELETE,OPTIONS always; - add_header Access-Control-Allow-Headers Authorization,Content-Type always; - - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/run/php/php8.4-fpm.sock; -# fastcgi_pass unix:/run/php/php7.3-fpm.sock; - } + location / { + proxy_pass http://localhost:8001; + } } diff --git a/nginx/sites-available/44303.conf b/nginx/sites-available/44303.conf new file mode 100644 index 0000000..d7fdb59 --- /dev/null +++ b/nginx/sites-available/44303.conf @@ -0,0 +1,16 @@ +server { + listen 44303 ssl; + + server_name api.vlw.se; + + include snippets/vlw.se-ssl; + + location / { + add_header 'Access-Control-Allow-Origin' $http_origin; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, Content-Type, Accept'; + + proxy_pass http://localhost:8003; + } +}