zoukankan      html  css  js  c++  java
  • 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;
     }
    
  • 相关阅读:
    Struts2中请求参数的接收方式和ModelDriven机制及其运用
    struts2获得请求参数的方式
    参数(parameter)和属性(Attribute)的区别
    getContextPath、getServletPath、getRequestURI,getRealPath的区别
    struts2的result的type属性
    Struts2的值栈和对象栈
    el表达式跟ognl表达式的区别(转)
    Struts学习之值栈的理解
    创建虚拟机-1
    安装kvm模块配置网络
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/14812200.html
Copyright © 2011-2022 走看看