You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nginx.conf 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # as simple as nginx user
  2. user nginx;
  3. # Set number of worker processes automatically based on number of CPU cores.
  4. worker_processes auto;
  5. # Enables the use of JIT for regular expressions to speed-up their processing.
  6. pcre_jit on;
  7. # Configures default error logger.
  8. error_log /var/log/nginx/error.log warn;
  9. events {
  10. # The maximum number of simultaneous connections that can be opened by
  11. # a worker process.
  12. worker_connections 1024;
  13. }
  14. http {
  15. # Includes mapping of file name extensions to MIME types of responses
  16. # and defines the default type.
  17. include /etc/nginx/mime.types;
  18. default_type application/octet-stream;
  19. # Name servers used to resolve names of upstream servers into addresses.
  20. # It's also needed when using tcpsocket and udpsocket in Lua modules.
  21. #resolver 208.67.222.222 208.67.220.220;
  22. # Don't tell nginx version to clients.
  23. server_tokens off;
  24. # Specifies the maximum accepted body size of a client request, as
  25. # indicated by the request header Content-Length. If the stated content
  26. # length is greater than this size, then the client receives the HTTP
  27. # error code 413. Set to 0 to disable.
  28. client_max_body_size 1m;
  29. # Timeout for keep-alive connections. Server will close connections after
  30. # this time.
  31. keepalive_timeout 65;
  32. # Sendfile copies data between one FD and other from within the kernel,
  33. # which is more efficient than read() + write().
  34. sendfile on;
  35. # Don't buffer data-sends (disable Nagle algorithm).
  36. # Good for sending frequent small bursts of data in real time.
  37. tcp_nodelay on;
  38. # Causes nginx to attempt to send its HTTP response head in one packet,
  39. # instead of using partial frames.
  40. #tcp_nopush on;
  41. # Path of the file with Diffie-Hellman parameters for EDH ciphers.
  42. #ssl_dhparam /etc/ssl/nginx/dh2048.pem;
  43. # Specifies that our cipher suits should be preferred over client ciphers.
  44. ssl_prefer_server_ciphers on;
  45. # Enables a shared SSL cache with size that can hold around 8000 sessions.
  46. ssl_session_cache shared:SSL:2m;
  47. # Enable gzipping of responses.
  48. #gzip on;
  49. # Set the Vary HTTP header as defined in the RFC 2616.
  50. gzip_vary on;
  51. # Enable checking the existence of precompressed files.
  52. #gzip_static on;
  53. # Specifies the main log format.
  54. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  55. # '$status $body_bytes_sent "$http_referer" '
  56. # '"$http_user_agent" "$http_x_forwarded_for"';
  57. # Sets the path, format, and configuration for a buffered log write.
  58. #access_log /var/log/nginx/access.log main;
  59. server {
  60. listen 80;
  61. listen [::]:80;
  62. server_name $GITEA_DOMAIN;
  63. client_max_body_size 200M;
  64. location / {
  65. proxy_pass http://localhost:3000;
  66. proxy_set_header Host $host;
  67. proxy_set_header X-Real-IP $remote_addr;
  68. }
  69. }
  70. }
  71. # redirect to ssl
  72. #server {
  73. # listen 80;
  74. # listen [::]:80;
  75. # server_name $GITEA_DOMAIN;
  76. # return 301 https://$server_name$request_uri;
  77. #}
  78. #server {
  79. # listen 443 ssl http2;
  80. # listen [::]:443 ssl http2;
  81. # server_name $GITEA_DOMAIN;
  82. # client_max_body_size 50M;
  83. # ssl_certificate /data/ssl/cert.crt;
  84. # ssl_certificate_key /data/ssl/cert.key;
  85. # location / {
  86. # proxy_pass http://localhost:3000;
  87. # proxy_set_header Host $host;
  88. # proxy_set_header X-Real-IP $remote_addr;
  89. # }
  90. #}