nginx.conf 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. user www-data;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4. events {
  5. worker_connections 768;
  6. # multi_accept on;
  7. }
  8. http {
  9. ##
  10. # Basic Settings
  11. ##
  12. sendfile on;
  13. tcp_nopush on;
  14. tcp_nodelay on;
  15. keepalive_timeout 65;
  16. types_hash_max_size 2048;
  17. # server_tokens off;
  18. # server_names_hash_bucket_size 64;
  19. # server_name_in_redirect off;
  20. include /etc/nginx/mime.types;
  21. default_type application/octet-stream;
  22. ##
  23. # SSL Settings
  24. ##
  25. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  26. ssl_prefer_server_ciphers on;
  27. ##
  28. # Logging Settings
  29. ##
  30. access_log /var/log/nginx/access.log;
  31. error_log /var/log/nginx/error.log;
  32. ##
  33. # Gzip Settings
  34. ##
  35. gzip on;
  36. gzip_disable "msie6";
  37. # gzip_vary on;
  38. # gzip_proxied any;
  39. # gzip_comp_level 6;
  40. # gzip_buffers 16 8k;
  41. # gzip_http_version 1.1;
  42. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  43. ##
  44. # Virtual Host Configs
  45. ##
  46. server {
  47. listen 443;
  48. server_name www.example.com;
  49. ssl on;
  50. ssl_certificate /etc/nginx/1_www.example.com_bundle.crt;
  51. ssl_certificate_key /etc/nginx/2_www.example.com.key;
  52. ssl_session_timeout 5m;
  53. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  54. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
  55. ssl_prefer_server_ciphers on;
  56. location / {
  57. proxy_pass http://localhost:8080;
  58. proxy_set_header Host $host;
  59. proxy_set_header X-Real-IP $remote_addr;
  60. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  61. }
  62. }
  63. server {
  64. listen 80;
  65. server_name www.example.com;
  66. rewrite https://$server_name$request_uri? permanent;
  67. }
  68. #include /etc/nginx/conf.d/*.conf;
  69. #include /etc/nginx/sites-enabled/*;
  70. }
  71. #mail {
  72. # # See sample authentication script at:
  73. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  74. #
  75. # # auth_http localhost/auth.php;
  76. # # pop3_capabilities "TOP" "USER";
  77. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  78. #
  79. # server {
  80. # listen localhost:110;
  81. # protocol pop3;
  82. # proxy on;
  83. # }
  84. #
  85. # server {
  86. # listen localhost:143;
  87. # protocol imap;
  88. # proxy on;
  89. # }
  90. #}