nginx.conf 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. user www-data;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4. include /etc/nginx/modules-enabled/*.conf;
  5. events {
  6. worker_connections 768;
  7. # multi_accept on;
  8. }
  9. http {
  10. ##
  11. # Basic Settings
  12. ##
  13. sendfile on;
  14. tcp_nopush on;
  15. types_hash_max_size 2048;
  16. # server_tokens off;
  17. # server_names_hash_bucket_size 64;
  18. # server_name_in_redirect off;
  19. include /etc/nginx/mime.types;
  20. default_type application/octet-stream;
  21. ##
  22. # SSL Settings
  23. ##
  24. ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
  25. ssl_prefer_server_ciphers on;
  26. ##
  27. # Logging Settings
  28. ##
  29. access_log /var/log/nginx/access.log;
  30. error_log /var/log/nginx/error.log;
  31. ##
  32. # Gzip Settings
  33. ##
  34. gzip on;
  35. client_max_body_size 0;
  36. server {
  37. listen 80;
  38. server_name daoguyujia.com www.daoguyujia.com;
  39. # rewrite ^/(.*) https://$server_name$1 permanent;
  40. location / {
  41. add_header Access-Control-Allow-Headers '*';
  42. add_header Access-Control-Allow-Origin '*';
  43. add_header Access-Control-Allow-Methods 'GET,POST,OPTIONS';
  44. add_header Access-Control-Allow-Credentials 'true';
  45. # proxy_pass http://127.0.0.1:81/;
  46. proxy_redirect off; #
  47. proxy_set_header Host $http_host;
  48. proxy_set_header X-Real-IP $remote_addr;
  49. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  50. # proxy_set_header X-NginX-Proxy true;
  51. }
  52. }
  53. # gzip_vary on;
  54. # gzip_proxied any;
  55. # gzip_comp_level 6;
  56. # gzip_buffers 16 8k;
  57. # gzip_http_version 1.1;
  58. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  59. ##
  60. # Virtual Host Configs
  61. ##
  62. include /etc/nginx/conf.d/*.conf;
  63. include /etc/nginx/sites-enabled/*;
  64. }
  65. #mail {
  66. # # See sample authentication script at:
  67. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  68. #
  69. # # auth_http localhost/auth.php;
  70. # # pop3_capabilities "TOP" "USER";
  71. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  72. #
  73. # server {
  74. # listen localhost:110;
  75. # protocol pop3;
  76. # proxy on;
  77. # }
  78. #
  79. # server {
  80. # listen localhost:143;
  81. # protocol imap;
  82. # proxy on;
  83. # }
  84. #}