Skip to content

Commit

Permalink
Deduplicated Nginx config
Browse files Browse the repository at this point in the history
- you can set these on the top-level `http` object and they get passed
  down, which means we can avoid duplication
  • Loading branch information
daniellockyer committed Nov 19, 2024
1 parent 4fed79d commit a82baa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
5 changes: 5 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ http {
https https;
}

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 $real_scheme;

include /etc/nginx/conf.d/*.conf;
}
20 changes: 0 additions & 20 deletions nginx/server.conf
Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
server {
location /.ghost/activitypub {
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 $real_scheme;

proxy_pass http://activitypub:8080;
}

location /.well-known/webfinger {
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 $real_scheme;

proxy_pass http://activitypub:8080;
}

location /.well-known/nodeinfo {
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 $real_scheme;

proxy_pass http://activitypub:8080;
}

location / {
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 $real_scheme;

proxy_pass http://host.docker.internal:2368;
}
}

0 comments on commit a82baa1

Please sign in to comment.