2017-10-04 05:26:00 +00:00
|
|
|
upstream backend {
|
2018-03-18 13:41:09 +00:00
|
|
|
server 127.0.0.1:9999; # Change to the port you specified on lolisafe
|
2017-10-04 05:26:00 +00:00
|
|
|
}
|
|
|
|
|
2018-05-19 07:57:19 +00:00
|
|
|
map $sent_http_content_type $charset {
|
|
|
|
~^text/ utf-8;
|
|
|
|
}
|
|
|
|
|
2017-10-04 05:26:00 +00:00
|
|
|
server {
|
2018-03-18 13:41:09 +00:00
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
2017-10-04 05:26:00 +00:00
|
|
|
|
|
|
|
server_name lolisafe.moe;
|
2018-05-19 07:57:19 +00:00
|
|
|
server_tokens off;
|
2017-10-04 05:26:00 +00:00
|
|
|
|
2018-03-18 13:41:09 +00:00
|
|
|
client_max_body_size 100M; # Change this to the max file size you want to allow
|
2017-10-04 05:26:00 +00:00
|
|
|
|
2018-05-19 07:57:19 +00:00
|
|
|
charset $charset;
|
2018-05-20 21:25:15 +00:00
|
|
|
charset_types *;
|
2018-05-19 07:57:19 +00:00
|
|
|
|
2018-02-12 04:49:11 +00:00
|
|
|
# Uncomment if you are running lolisafe behind CloudFlare.
|
2018-04-02 06:53:26 +00:00
|
|
|
# This requires NGINX compiled from source with:
|
|
|
|
# --with-http_realip_module
|
2018-04-02 06:52:09 +00:00
|
|
|
#include /path/to/lolisafe/real-ip-from-cf;
|
2018-02-12 04:49:11 +00:00
|
|
|
|
2017-10-04 05:26:00 +00:00
|
|
|
location / {
|
|
|
|
add_header Access-Control-Allow-Origin *;
|
|
|
|
root /path/to/your/uploads/folder;
|
|
|
|
try_files $uri @proxy;
|
|
|
|
}
|
|
|
|
|
2018-03-18 13:41:09 +00:00
|
|
|
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;
|
|
|
|
}
|
2017-10-04 05:26:00 +00:00
|
|
|
}
|