nginx 配置http,https,ip

http

server
 {
 	 listen 80;
 	 #listen [::]:80 default_server ipv6only=on;
 	 server_name smart.sqwisdom.net;
 	 index index.html index.htm admin.php;
 	 root /home/wwwroot/default/smart/smart-community/Public;
 	 #error_page 404 /404.html;
 	 include enable-php-pathinfo.conf;
 	 location /nginx_status
 	 {
 	 	stub_status on;
 	 	access_log off;
 	 }
 	 location / { 
 		 if (!-e $request_filename) { 
 			 rewrite ^/smart/(.*)$ /api.php?s=$1 last; 
 			 break; 
 			 rewrite ^(.*)$ /index.php?s=/$1 last; 
 		 }
 		 if (!-e $request_filename) { 
 			 rewrite ^(.*)$ /admin.php?s=$1 last; 
 		 } 
 	 } 
 	 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
 	 {
 	 	expires 30d;
 	 }
 	 location ~ .*\.(js|css)?$
 	 {
 	 	expires 12h;
 	 }
 	 location ~ /\.
 	 {
 	 	deny all;
 	 }
 	 access_log /home/wwwlogs/access_smart.log;
 }

https

server
{
 	 listen 443 ssl;
 	 #listen [::]:80 default_server ipv6only=on;
 	 server_name smart.sqwisdom.net;
 	 index index.html index.htm admin.php;
 	 root /home/wwwroot/default/smart/smart-community/Public;
 	 #error_page 404 /404.html;
 	 include enable-php-pathinfo.conf;
	 
	 ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
	 ssl_certificate smart.sqwisdom.net_chain.crt;
	 ssl_certificate_key smart.sqwisdom.net_key.key;
	 ssl_prefer_server_ciphers on;

 	 location /nginx_status
 	 {
 	 	stub_status on;
 	 	access_log off;
 	 }
 	 location / { 
 		 if (!-e $request_filename) { 
 			 rewrite ^/smart/(.*)$ /api.php?s=$1 last; 
 			 break; 
 			 rewrite ^(.*)$ /index.php?s=/$1 last; 
 		 }
 		 if (!-e $request_filename) { 
 			 rewrite ^(.*)$ /admin.php?s=$1 last; 
 		 } 
 	 } 
 	 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
 	 {
 	 	expires 30d;
 	 }
 	 location ~ .*\.(js|css)?$
 	 {
 	 	expires 12h;
 	 }
 	 location ~ /\.
 	 {
 	 	deny all;
 	 }
 	 access_log /home/wwwlogs/access_smart.log;
}

ip

server
 {
 	 listen 8089;
 	 #listen [::]:80 default_server ipv6only=on;
 	 server_name 127.0.0.1:8089;
 	 index index.html index.htm admin.php;
 	 root /home/wwwroot/default/smart/smart-community/Public;
 	 #error_page 404 /404.html;
 	 include enable-php-pathinfo.conf;
 	 location /nginx_status
 	 {
 	 	stub_status on;
 	 	access_log off;
 	 }
 	 location / { 
 		 if (!-e $request_filename) { 
 			 rewrite ^/smart/(.*)$ /api.php?s=$1 last; 
 			 break; 
 			 rewrite ^(.*)$ /index.php?s=/$1 last; 
 		 }
 		 if (!-e $request_filename) { 
 			 rewrite ^(.*)$ /admin.php?s=$1 last; 
 		 } 
 	 } 
 	 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
 	 {
 	 	expires 30d;
 	 }
 	 location ~ .*\.(js|css)?$
 	 {
 	 	expires 12h;
 	 }
 	 location ~ /\.
 	 {
 	 	deny all;
 	 }
 	 access_log /home/wwwlogs/access_smart.log;
 }

nginx 配置http,https,ip

上一篇:2021-06-20:已知一个消息流会不断地吐出整数 1~N,但不一定按照顺序依次吐出。如果上次打印的序号为i, 那么当i+1出现时,请打印 i+1 及其之后接收过的并且连续的所有数,直到1~N全部接


下一篇:解析漏洞总结(apache,nginx,IIS)