diff options
| author | 8cy <[email protected]> | 2020-05-23 02:24:18 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-05-23 02:24:18 -0700 |
| commit | 454825558aef4320c82b3d3148537038364c9427 (patch) | |
| tree | fc8366ce0203fd58bb65d843c04608d25a08ab16 /nginx.sample.conf | |
| download | strelizia-master.tar.xz strelizia-master.zip | |
Diffstat (limited to 'nginx.sample.conf')
| -rw-r--r-- | nginx.sample.conf | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/nginx.sample.conf b/nginx.sample.conf new file mode 100644 index 0000000..07b69e5 --- /dev/null +++ b/nginx.sample.conf @@ -0,0 +1,45 @@ +upstream backend { + server 127.0.0.1:9999; # Change to the port you specified on strelizia +} + +map $sent_http_content_type $charset { + ~^text/ utf-8; +} + +server { + listen 80; + listen [::]:80; + + server_name strelizia.cc; + server_tokens off; + + client_max_body_size 100M; # Change this to the max file size you want to allow + + charset $charset; + charset_types *; + + # Uncomment if you are running strelizia behind CloudFlare. + # This requires NGINX compiled from source with: + # --with-http_realip_module + #include /path/to/strelizia/real-ip-from-cf; + + location / { + add_header Access-Control-Allow-Origin *; + root /path/to/your/uploads/folder; + try_files $uri @proxy; + } + + location @proxy { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://backend; + proxy_redirect off; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_redirect off; + proxy_set_header X-Forwarded-Proto $scheme; + } +} |