1 log_format www.44755.com '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' 2 '"$http_user_agent" $http_x_forwarded_for'; 3 server 4 { 5 listen 80; 6 listen 443 ssl; 7 server_name www.44755.com; 8 index index.html index.htm index.php default.html default.htm default.php; 9 root /data/www/44755; 10 #include cindex.conf; 11 12 location ~ \.git 13 { 14 deny all; 15 } 16 17 location / { 18 if (!-e $request_filename){ 19 rewrite (.*) /index.php; 20 } 21 } 22 23 location ~ ^/bbs/.*\.(php|php5)?$ 24 { 25 root /data/www; 26 27 #try_files $uri =404; 28 #fastcgi_pass unix:/tmp/php-cgi.sock; 29 fastcgi_pass 127.0.0.1:9000; 30 fastcgi_index index.php; 31 include fastcgi.conf; 32 } 33 '$status $body_bytes_sent "$http_referer" ' 34 '"$http_user_agent" $http_x_forwarded_for'; 35 server 36 { 37 listen 80; 38 listen 443 ssl; 39 server_name www.44755.com; 40 index index.html index.htm index.php default.html default.htm default.php; 41 root /data/www/44755; 42 #include cindex.conf; 43 44 location ~ \.git 45 { 46 deny all; 47 } 48 49 location / { 50 if (!-e $request_filename){ 51 rewrite (.*) /index.php; 52 } 53 } 54 55 location ~ ^/bbs/.*\.(php|php5)?$ 56 { 57 root /data/www; 58 59 #try_files $uri =404; 60 #fastcgi_pass unix:/tmp/php-cgi.sock; 61 fastcgi_pass 127.0.0.1:9000; 62 fastcgi_index index.php; 63 include fastcgi.conf; 64 } 65 location ~ ^/bbs/.*\.(php|php5)?$ 66 { 67 root /data/www; 68 #try_files $uri =404; 69 #fastcgi_pass unix:/tmp/php-cgi.sock; 70 fastcgi_pass 127.0.0.1:9000; 71 fastcgi_index index.php; 72 include fastcgi.conf; 73 } 74 location ~ ^/bbs { 75 root /data/www; 76 } 77 location ~ .*\.(php|php5)?$ 78 { 79 #try_files $uri =404; 80 #fastcgi_pass unix:/tmp/php-cgi.sock; 81 fastcgi_pass 127.0.0.1:9000; 82 fastcgi_index index.php; 83 include fastcgi.conf; 84 } 85 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ 86 { 87 expires 30s; 88 } 89 location ~ .*\.(js|css)?$ 90 { 91 expires 12s; 92 } 93 ssl_certificate /usr/local/nginx/conf/sslkey/1_www.44755.com_bundle.crt; 94 ssl_certificate_key /usr/local/nginx/conf/sslkey/2_www.44755.com.key; 95 ssl_session_timeout 5m; 96 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 97 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 98 ssl_prefer_server_ciphers on; 99 #access_log /data/logs/www.44755.com.log www.44755.com; 100 access_log off; 101 error_log /data/logs/solo.44755.com.err.log; 102 }
1 server { 2 listen 80; 3 listen 443 ssl; 4 server_name test.xx.com; 5 index index.html index.htm index.php; 6 root /usr/local/default; 7 location ~ .*\.(php|php5)?$ 8 { 9 #fastcgi_pass unix:/tmp/php-cgi.sock; 10 fastcgi_pass 127.0.0.1:9000; 11 fastcgi_index index.php; 12 include fastcgi.conf; 13 } 14 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ 15 { 16 #expires 30d; 17 } 18 location ~ .*\.(js|css)?$ 19 { 20 #expires 1h; 21 } 22 23 access_log logs/test.access.log; 24 ssl_certificate /x.com_bundle.crt; 25 ssl_certificate_key /x.com.key; 26 ssl_session_timeout 5m; 27 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 28 ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; 29 ssl_prefer_server_ciphers on; 30 }
http默認是80端口,https默認是443端口