mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-10 09:51:51 +02:00
Fix reverse proxy subpath support (#192)
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
# Use Nginx as a reverse proxy
|
||||
|
||||
Configure Nginx to proxy requests to Opengist. Here is an example configuration file :
|
||||
Configure Nginx to proxy requests to Opengist. Here are example configuration file to use Opengist on a subdomain or on a subpath.
|
||||
|
||||
Make sure you set the base url for Opengist via the [configuration](/docs/configuration/cheat-sheet.md).
|
||||
|
||||
### Subdomain
|
||||
```
|
||||
server {
|
||||
listen 80;
|
||||
@ -16,7 +20,27 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
Then run :
|
||||
```shell
|
||||
service nginx restart
|
||||
### Subpath
|
||||
```
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location /opengist/ {
|
||||
rewrite ^/opengist(/.*)$ $1 break;
|
||||
proxy_pass http://127.0.0.1:6157;
|
||||
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 X-Forwarded-Prefix /opengist;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
To apply changes:
|
||||
```shell
|
||||
sudo systemctl restart nginx
|
||||
```
|
||||
|
Reference in New Issue
Block a user