50 lines
1.6 KiB
Text
50 lines
1.6 KiB
Text
server {
|
|
listen 80;
|
|
|
|
# Root redirects to Ghost
|
|
location / {
|
|
return 302 /ghost/;
|
|
}
|
|
|
|
# Ghost CMS proxy at /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 Accept-Encoding "";
|
|
proxy_hide_header Cache-Control;
|
|
add_header Cache-Control "no-store";
|
|
|
|
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/';
|
|
}
|
|
|
|
# Forgejo proxy at /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_set_header Accept-Encoding "";
|
|
proxy_hide_header Cache-Control;
|
|
add_header Cache-Control "no-store";
|
|
|
|
sub_filter_once off;
|
|
sub_filter_types text/html text/css application/javascript;
|
|
sub_filter 'href="/' 'href="/forgejo/';
|
|
sub_filter 'src="/' 'src="/forgejo/';
|
|
sub_filter 'content="/' 'content="/forgejo/';
|
|
sub_filter 'url(/' 'url(/forgejo/';
|
|
}
|
|
}
|