Advertisement
Guest User

nginx.conf

a guest
May 7th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1.  
  2. #user nobody;
  3. #Defines which Linux system user will own and run the Nginx server
  4.  
  5. worker_processes 1;
  6. #Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
  7.  
  8. #error_log logs/error.log; #error_log logs/error.log notice;
  9. #Specifies the file where server logs.
  10.  
  11. #pid logs/nginx.pid;
  12. #nginx will write its master process ID(PID).
  13.  
  14. events {
  15. worker_connections 1024;
  16. # worker_processes and worker_connections allows you to calculate maxclients value:
  17. # max_clients = worker_processes * worker_connections
  18. }
  19.  
  20.  
  21. http {
  22. include mime.types;
  23. # anything written in /opt/nginx/conf/mime.types is interpreted as if written inside the http { } block
  24.  
  25. default_type application/octet-stream;
  26. #
  27.  
  28. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  29. # '$status $body_bytes_sent "$http_referer" '
  30. # '"$http_user_agent" "$http_x_forwarded_for"';
  31.  
  32. #access_log logs/access.log main;
  33.  
  34. sendfile on;
  35. # If serving locally stored static files, sendfile is essential to speed up the server,
  36. # But if using as reverse proxy one can deactivate it
  37.  
  38. #tcp_nopush on;
  39. # works opposite to tcp_nodelay. Instead of optimizing delays, it optimizes the amount of data sent at once.
  40.  
  41. #keepalive_timeout 0;
  42. keepalive_timeout 65;
  43. # timeout during which a keep-alive client connection will stay open.
  44.  
  45. #gzip on;
  46. # tells the server to use on-the-fly gzip compression.
  47.  
  48. server {
  49. # You would want to make a separate file with its own server block for each virtual domain
  50. # on your server and then include them.
  51. listen 80;
  52. #tells Nginx the hostname and the TCP port where it should listen for HTTP connections.
  53. # listen 80; is equivalent to listen *:80;
  54.  
  55. server_name localhost;
  56. # lets you doname-based virtual hosting
  57.  
  58. #charset koi8-r;
  59.  
  60. #access_log logs/host.access.log main;
  61.  
  62. location / {
  63. #The location setting lets you configure how nginx responds to requests for resources within the server.
  64. root html;
  65. index index.html index.htm;
  66. }
  67.  
  68. #error_page 404 /404.html;
  69.  
  70. # redirect server error pages to the static page /50x.html
  71. #
  72. error_page 500 502 503 504 /50x.html;
  73. location = /50x.html {
  74. root html;
  75. }
  76.  
  77. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  78. #
  79. #location ~ \.php$ {
  80. # proxy_pass http://127.0.0.1;
  81. #}
  82.  
  83. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  84. #
  85. #location ~ \.php$ {
  86. # root html;
  87. # fastcgi_pass 127.0.0.1:9000;
  88. # fastcgi_index index.php;
  89. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  90. # include fastcgi_params;
  91. #}
  92.  
  93. # deny access to .htaccess files, if Apache's document root
  94. # concurs with nginx's one
  95. #
  96. #location ~ /\.ht {
  97. # deny all;
  98. #}
  99. }
  100.  
  101.  
  102. # another virtual host using mix of IP-, name-, and port-based configuration
  103. #
  104. #server {
  105. # listen 8000;
  106. # listen somename:8080;
  107. # server_name somename alias another.alias;
  108.  
  109. # location / {
  110. # root html;
  111. # index index.html index.htm;
  112. # }
  113. #}
  114.  
  115.  
  116. # HTTPS server
  117. #
  118. #server {
  119. # listen 443 ssl;
  120. # server_name localhost;
  121.  
  122. # ssl_certificate cert.pem;
  123. # ssl_certificate_key cert.key;
  124.  
  125. # ssl_session_cache shared:SSL:1m;
  126. # ssl_session_timeout 5m;
  127.  
  128. # ssl_ciphers HIGH:!aNULL:!MD5;
  129. # ssl_prefer_server_ciphers on;
  130.  
  131. # location / {
  132. # root html;
  133. # index index.html index.htm;
  134. # }
  135. #}
  136.  
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement