nginx.sample.conf 1.2 KB

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