1 | user nginx nginx; |
---|
2 | worker_processes 1; |
---|
3 | |
---|
4 | error_log /var/log/nginx/error_log info; |
---|
5 | |
---|
6 | events { |
---|
7 | worker_connections 1024; |
---|
8 | use epoll; |
---|
9 | } |
---|
10 | |
---|
11 | http { |
---|
12 | include /etc/nginx/mime.types; |
---|
13 | default_type application/octet-stream; |
---|
14 | |
---|
15 | log_format main |
---|
16 | '$remote_addr - $remote_user [$time_local] ' |
---|
17 | '"$request" $status $bytes_sent ' |
---|
18 | '"$http_referer" "$http_user_agent" ' |
---|
19 | '"$gzip_ratio"'; |
---|
20 | |
---|
21 | client_header_timeout 10m; |
---|
22 | client_body_timeout 10m; |
---|
23 | send_timeout 10m; |
---|
24 | |
---|
25 | connection_pool_size 256; |
---|
26 | client_header_buffer_size 1k; |
---|
27 | large_client_header_buffers 4 2k; |
---|
28 | request_pool_size 4k; |
---|
29 | |
---|
30 | gzip on; |
---|
31 | gzip_min_length 1100; |
---|
32 | gzip_buffers 4 8k; |
---|
33 | gzip_types text/plain; |
---|
34 | |
---|
35 | output_buffers 1 32k; |
---|
36 | postpone_output 1460; |
---|
37 | |
---|
38 | sendfile on; |
---|
39 | tcp_nopush on; |
---|
40 | tcp_nodelay on; |
---|
41 | |
---|
42 | keepalive_timeout 75 20; |
---|
43 | |
---|
44 | ignore_invalid_headers on; |
---|
45 | |
---|
46 | ssl_session_cache shared:SSL:10m; |
---|
47 | |
---|
48 | index index.html; |
---|
49 | |
---|
50 | server { |
---|
51 | listen 127.0.0.1; |
---|
52 | server_name localhost; |
---|
53 | |
---|
54 | access_log /var/log/nginx/localhost.access_log main; |
---|
55 | error_log /var/log/nginx/localhost.error_log info; |
---|
56 | |
---|
57 | root /var/www/localhost/htdocs; |
---|
58 | } |
---|
59 | |
---|
60 | # SSL example |
---|
61 | server { |
---|
62 | listen 127.0.0.1:443; |
---|
63 | server_name localhost; |
---|
64 | |
---|
65 | ssl on; |
---|
66 | ssl_certificate /etc/ssl/nginx/nginx-server.pem; |
---|
67 | ssl_client_certificate /etc/ssl/nginx/cacert.pem; |
---|
68 | ssl_certificate_key /etc/ssl/nginx/nginx.key; |
---|
69 | ssl_verify_client optional; |
---|
70 | |
---|
71 | access_log /var/log/nginx/localhost.ssl_access_log main; |
---|
72 | error_log /var/log/nginx/localhost.ssl_error_log info; |
---|
73 | |
---|
74 | root /var/www/localhost/htdocs; |
---|
75 | |
---|
76 | set $web2pyroot /home/Desktop/source/michelecomitini-facebookaccess; |
---|
77 | |
---|
78 | |
---|
79 | location /pki/ { |
---|
80 | root /var/www/localhost/html; |
---|
81 | } |
---|
82 | |
---|
83 | location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ { |
---|
84 | alias $web2pyroot/applications/$1/static/$2; |
---|
85 | expires max; |
---|
86 | } |
---|
87 | |
---|
88 | location / { |
---|
89 | include /etc/nginx/scgi_params; |
---|
90 | scgi_pass 127.0.0.1:4000; |
---|
91 | |
---|
92 | #Module ngx_http_ssl_module supports the following built-in variables: |
---|
93 | |
---|
94 | #$ssl_cipher returns the cipher suite being used for the currently established SSL/TLS connection |
---|
95 | #$ssl_client_serial returns the serial number of the client certificate for the currently established SSL/TLS connection — if applicable, i.e., if client authentication is activated in the connection |
---|
96 | #$ssl_client_s_dn returns the subject Distinguished Name (DN) of the client certificate for the currently established SSL/TLS connection — if applicable, i.e., if client authentication is activated in the connection |
---|
97 | #$ssl_client_i_dn returns the issuer DN of the client certificate for the currently established SSL/TLS connection — if applicable, i.e., if client authentication is activated in the connection |
---|
98 | #$ssl_protocol returns the protocol of the currently established SSL/TLS connection — depending on the configuration and client available options it's one of SSLv2, SSLv3 or TLSv1 |
---|
99 | #$ssl_session_id the Session ID of the established secure connection — requires Nginx version greater or equal to 0.8.20 |
---|
100 | #$ssl_client_cert |
---|
101 | #$ssl_client_raw_cert |
---|
102 | #$ssl_client_verify takes the value "SUCCESS" when the client certificate is successfully verified |
---|
103 | scgi_param SSL_PROTOCOL $ssl_protocol; |
---|
104 | scgi_param HTTPS on; |
---|
105 | scgi_param SSL_CIPHER $ssl_cipher; |
---|
106 | scgi_param SSL_CLIENT_SERIAL $ssl_client_serial; |
---|
107 | scgi_param SSL_CLIENT_S_DN $ssl_client_s_dn; |
---|
108 | scgi_param SSL_CLIENT_I_DN $ssl_client_i_dn; |
---|
109 | scgi_param SSL_SESSION_ID $ssl_session_id; |
---|
110 | scgi_param SSL_CLIENT_CERT $ssl_client_cert; |
---|
111 | scgi_param SSL_CLIENT_RAW_CERT $ssl_client_raw_cert; |
---|
112 | scgi_param SSL_CLIENT_VERIFY $ssl_client_verify; |
---|
113 | } |
---|
114 | } |
---|
115 | } |
---|