nginx.conf 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #user nobody;
  2. worker_processes 1;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6. #pid logs/nginx.pid;
  7. events {
  8. worker_connections 1024;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  14. # '$status $body_bytes_sent "$http_referer" '
  15. # '"$http_user_agent" "$http_x_forwarded_for"';
  16. #access_log logs/access.log main;
  17. sendfile on;
  18. #tcp_nopush on;
  19. #keepalive_timeout 0;
  20. keepalive_timeout 65;
  21. gzip on;
  22. gzip_types text/plain application/javascript;
  23. server {
  24. listen 1313;
  25. server_name localhost;
  26. #charset koi8-r;
  27. #access_log logs/host.access.log main;
  28. #root /Users/xiaopengzhang/Develop/hugo/public/;
  29. #index index.html;
  30. location /public {
  31. root /Users/xiaopengzhang/Develop/hugo/;
  32. index index.html;
  33. try_files $uri /index.html;
  34. }
  35. location /editor {
  36. root /Users/xiaopengzhang/Downloads/qingdan/front/;
  37. index index.html;
  38. try_files $uri /editor/index.html;
  39. }
  40. location /editor/qingdan {
  41. root /Users/xiaopengzhang/Downloads/qingdan/front/;
  42. index index.html;
  43. try_files $uri @rewrites;
  44. }
  45. location @rewrites {
  46. rewrite ^/editor/qingdan/(.*) /editor/$1 last;
  47. }
  48. location /api {
  49. rewrite ^/api/(.*)$ /$1 break;
  50. proxy_pass http://127.0.0.1:8000;
  51. }
  52. location / {
  53. root /Users/xiaopengzhang/Develop/hugo/public/;
  54. index index.html;
  55. try_files $uri /index.html;
  56. }
  57. #error_page 404 /404.html;
  58. # redirect server error pages to the static page /50x.html
  59. #
  60. error_page 500 502 503 504 /50x.html;
  61. location = /50x.html {
  62. root html;
  63. }
  64. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  65. #
  66. #location ~ \.php$ {
  67. # proxy_pass http://127.0.0.1;
  68. #}
  69. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  70. #
  71. #location ~ \.php$ {
  72. # root html;
  73. # fastcgi_pass 127.0.0.1:9000;
  74. # fastcgi_index index.php;
  75. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  76. # include fastcgi_params;
  77. #}
  78. # deny access to .htaccess files, if Apache's document root
  79. # concurs with nginx's one
  80. #
  81. #location ~ /\.ht {
  82. # deny all;
  83. #}
  84. }
  85. # another virtual host using mix of IP-, name-, and port-based configuration
  86. #
  87. #server {
  88. # listen 8000;
  89. # listen somename:8080;
  90. # server_name somename alias another.alias;
  91. # location / {
  92. # root html;
  93. # index index.html index.htm;
  94. # }
  95. #}
  96. # HTTPS server
  97. #
  98. #server {
  99. # listen 443 ssl;
  100. # server_name localhost;
  101. # ssl_certificate cert.pem;
  102. # ssl_certificate_key cert.key;
  103. # ssl_session_cache shared:SSL:1m;
  104. # ssl_session_timeout 5m;
  105. # ssl_ciphers HIGH:!aNULL:!MD5;
  106. # ssl_prefer_server_ciphers on;
  107. # location / {
  108. # root html;
  109. # index index.html index.htm;
  110. # }
  111. #}
  112. include servers/*;
  113. }