nginx.sample.conf 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. upstream backend {
  2. server 127.0.0.1:9999; # Change to the port you specified on lolisafe
  3. }
  4. server {
  5. listen 80;
  6. listen [::]:80;
  7. server_name lolisafe.moe;
  8. client_max_body_size 100M; # Change this to the max file size you want to allow
  9. # Uncomment if you are running lolisafe behind CloudFlare.
  10. # This requires NGINX compiled from source with:
  11. # --with-http_realip_module
  12. #include /path/to/lolisafe/real-ip-from-cf;
  13. location / {
  14. add_header Access-Control-Allow-Origin *;
  15. root /path/to/your/uploads/folder;
  16. try_files $uri @proxy;
  17. }
  18. location @proxy {
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_set_header Host $http_host;
  22. proxy_set_header X-NginX-Proxy true;
  23. proxy_pass http://backend;
  24. proxy_redirect off;
  25. proxy_http_version 1.1;
  26. proxy_set_header Upgrade $http_upgrade;
  27. proxy_set_header Connection "upgrade";
  28. proxy_redirect off;
  29. proxy_set_header X-Forwarded-Proto $scheme;
  30. }
  31. }