Difference between revisions of "Nginx.conf"

From wikieduonline
Jump to navigation Jump to search
(Redirected page to /etc/nginx/nginx.conf)
Tag: New redirect
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Nginx]]
+
#redirect [[/etc/nginx/nginx.conf]]
 
 
 
 
* Error log file: <code>/var/log/nginx/error.log</code>
 
* Access log file: <code>/var/log/nginx/access.log</code>
 
 
 
 
 
== Examples ==
 
* [[Track Application Response time in Nginx]]
 
 
 
==Directives ==
 
 
[[server_name]] YOUR_DOMAIN.COM;<ref>http://nginx.org/en/docs/http/server_names.html</ref>
 
root /var/www/your_domain;
 
 
 
:<code>listen</code><ref>http://nginx.org/en/docs/http/ngx_http_core_module.html#listen</ref>
 
::<code>listen 443 ssl;</code>
 
::<code>listen 80;</code>
 
 
 
:<code>[[try_files]] $uri $uri/ @rewrite;</code>
 
 
 
:<code>[[fastcgi_pass]]</code> (Used for [[PHP]])
 
 
 
:<code>[[rewrite]]</code>
 
 
 
:<code>[[location]]</code>
 
 
 
:<code>[[upstream]]</code>
 
:<code>[[proxy_pass]]</code>
 
 
 
:<code>[[return]]</code>
 
 
 
:<code>worker_processes auto;</code>
 
:<code>sendfile on;</code><ref>https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/#enabling-sendfile</ref>
 
:<code>include /etc/nginx/mime.types;</code>
 
:<code>tcp_nopush on;</code>
 
:<code>tcp_nodelay on;</code>
 
:<code>[[chunked_transfer_encoding]]</code>
 
 
 
:<code>server_tokens off;</code> (Context: http, server, location) (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens)
 
 
 
[[Proxy]] (Nginx can proxy requests using http, [[FastCGI]], uwsgi, SCGI, or memcached.)
 
:<code>proxy_read_timeout 2400s;</code>
 
:<code>proxy_connect_timeout 75s;</code>
 
:<code>proxy_send_timeout 2400s;</code>
 
:<code>proxy_buffer_size 32k;</code>
 
:<code>proxy_buffers 40 32k;</code>
 
:<code>proxy_busy_buffers_size 64k;</code>
 
:<code>proxy_temp_file_write_size 250m;</code>
 
:<code>proxy_http_version 1.1;</code>
 
:<code>proxy_redirect [default|off|redirect replacement]</code><ref>http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect</ref>
 
 
 
 
 
[[SSL]] (See also: <code>[[certbot]]</code>)
 
{{nginx SSL directives}}
 
 
 
== See also ==
 
* {{nginx}}
 
* [[Apache web server]]
 
* [[Reverse proxy]]
 
 
 
[[Category:Web server software]]
 

Latest revision as of 10:50, 3 March 2021

Advertising: