Guest User

nginx.conf

a guest
May 24th, 2022
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. user http;
  2. worker_processes auto;
  3. worker_rlimit_nofile 100000;
  4.  
  5. error_log /var/log/nginx/error.log crit;
  6.  
  7. events {
  8. worker_connections 4096;
  9.  
  10. use epoll;
  11.  
  12. multi_accept on;
  13. }
  14.  
  15.  
  16. http {
  17. #error_log /var/log/nginx/error.log warn;
  18.  
  19. open_file_cache max=200000 inactive=20s;
  20. open_file_cache_valid 30s;
  21. open_file_cache_min_uses 2;
  22. open_file_cache_errors on;
  23.  
  24. access_log off;
  25.  
  26. sendfile on;
  27.  
  28. tcp_nopush on;
  29.  
  30. tcp_nodelay on;
  31.  
  32. gzip on;
  33. # gzip_static on;
  34. gzip_min_length 10240;
  35. gzip_comp_level 1;
  36. gzip_vary on;
  37. gzip_disable msie6;
  38. gzip_proxied expired no-cache no-store private auth;
  39. gzip_types
  40. # text/html is always compressed by HttpGzipModule
  41. text/css
  42. text/javascript
  43. text/xml
  44. text/plain
  45. text/x-component
  46. application/javascript
  47. application/x-javascript
  48. application/json
  49. application/xml
  50. application/rss+xml
  51. application/atom+xml
  52. font/truetype
  53. font/opentype
  54. application/vnd.ms-fontobject
  55. image/svg+xml;
  56.  
  57.  
  58.  
  59. include mime.types;
  60. default_type application/octet-stream;
  61.  
  62. types_hash_max_size 4096;
  63. server_names_hash_bucket_size 128;
  64.  
  65. server_tokens off;
  66. keepalive_timeout 65;
  67.  
  68. # relevant if request takes longer (e.g. large files download) to not timeout to early.
  69. proxy_connect_timeout 600;
  70. proxy_send_timeout 600;
  71. proxy_read_timeout 600;
  72. send_timeout 600;
  73.  
  74. #gzip off;
  75.  
  76. server {
  77. listen 80;
  78. listen [::]:80;
  79. server_name myserver.net;
  80.  
  81. client_max_body_size 16G;
  82.  
  83. #set root to empty directory, in order to avoid exploiting real data
  84. root /srv/http;
  85.  
  86. location / {
  87. proxy_set_header X-Forwarded-Host $host;
  88. proxy_set_header X-Forwarded-Server $host;
  89. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  90. proxy_pass http://localhost:8080;
  91. proxy_buffer_size 8k;
  92. proxy_ignore_client_abort on;
  93. client_max_body_size 100m;
  94. }
  95.  
  96. location /.well-known/carddav {
  97. return 301 $scheme://$host/remote.php/dav;
  98. }
  99.  
  100. location /.well-known/caldav {
  101. return 301 $scheme://$host/remote.php/dav;
  102. }
  103. }
  104.  
  105. }
  106.  
Advertisement
Add Comment
Please, Sign In to add comment