default.conf.conf-old7
1 server { 2 listen 80; 3 4 # Root redirects to Ghost 5 location / { 6 return 302 /ghost/; 7 } 8 9 # Ghost CMS proxy at /ghost/ 10 location /ghost/ { 11 proxy_pass http://ghost_dev:2368/; 12 proxy_set_header Host $host; 13 proxy_set_header X-Real-IP $remote_addr; 14 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 15 proxy_set_header X-Forwarded-Proto $scheme; 16 17 proxy_set_header Accept-Encoding ""; 18 proxy_hide_header Cache-Control; 19 add_header Cache-Control "no-store"; 20 21 sub_filter_once off; 22 sub_filter_types text/html text/css application/javascript; 23 sub_filter 'href="/' 'href="/ghost/'; 24 sub_filter 'src="/' 'src="/ghost/'; 25 sub_filter 'content="/' 'content="/ghost/'; 26 sub_filter 'url(/' 'url(/ghost/'; 27 } 28 29 # Forgejo proxy at /forgejo/ 30 location /forgejo/ { 31 rewrite ^/forgejo(/.*)$ $1 break; 32 proxy_pass http://forgejo_dev:3000; 33 34 proxy_set_header Host $host; 35 proxy_set_header X-Real-IP $remote_addr; 36 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 37 proxy_set_header X-Forwarded-Proto $scheme; 38 39 proxy_set_header Accept-Encoding ""; 40 proxy_hide_header Cache-Control; 41 add_header Cache-Control "no-store"; 42 43 sub_filter_once off; 44 sub_filter_types text/html text/css application/javascript; 45 sub_filter 'href="/' 'href="/forgejo/'; 46 sub_filter 'src="/' 'src="/forgejo/'; 47 sub_filter 'content="/' 'content="/forgejo/'; 48 sub_filter 'url(/' 'url(/forgejo/'; 49 } 50 }