nonworking nginx config... considering removing this for dev and returning back to it in the future... saving this version for future examination

This commit is contained in:
2025-05-26 17:54:48 -05:00
parent 7c11e6163c
commit 5c783d7bf4
4 changed files with 730 additions and 34 deletions
+18 -12
View File
@@ -1,42 +1,48 @@
server {
listen 80;
location / {
# Redirect root to /ghost/ only for exact root requests
location = / {
return 302 /ghost/;
}
# Proxy for Ghost
location /ghost/ {
proxy_pass http://ghost_dev:2368/;
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-Proto $scheme;
proxy_set_header Host ;
proxy_set_header X-Real-IP ;
proxy_set_header X-Forwarded-For ;
proxy_set_header X-Forwarded-Proto ;
# Prevent caching
proxy_set_header Accept-Encoding "";
proxy_hide_header Cache-Control;
add_header Cache-Control "no-store";
# Rewrite URLs in responses
sub_filter_once off;
sub_filter_types text/html text/css application/javascript;
sub_filter 'href="/' 'href="/ghost/';
sub_filter 'src="/' 'src="/ghost/';
sub_filter 'content="/' 'content="/ghost/';
sub_filter 'url(/' 'url(/ghost/';
sub_filter '"/ghost/ghost/' '"/ghost/';
}
# Proxy for Forgejo
location /forgejo/ {
rewrite ^/forgejo(/.*)$ $1 break;
proxy_pass http://forgejo_dev:3000;
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-Proto $scheme;
proxy_pass http://forgejo_dev:3000/;
proxy_set_header Host ;
proxy_set_header X-Real-IP ;
proxy_set_header X-Forwarded-For ;
proxy_set_header X-Forwarded-Proto ;
# Prevent caching
proxy_set_header Accept-Encoding "";
proxy_hide_header Cache-Control;
add_header Cache-Control "no-store";
# Rewrite URLs in responses
sub_filter_once off;
sub_filter_types text/html text/css application/javascript;
sub_filter 'href="/' 'href="/forgejo/';