备份的Nginx 配置 可参考


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
	client_max_body_size 500M; 

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
	
	upstream loginport{
        server  127.0.0.1:33330;
    }
	
	server {
        listen       8844;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
			
            #root   html;
			#return 301 http://115.159.33.237:33330;
			proxy_pass http://115.159.33.237:33330;
			#proxy_redirect default;
            #index  index.html index.htm index.php;
		}
     
    }
	

    server {
        listen       80;
        server_name  www.ff11sf.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm index.php;
		}
		
		location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			#fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

   
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

     
    }
	
	server {
        listen       80;
        server_name  www.zanglikun.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   F:/wordpressRun/zanglikun;
            index  index.html index.htm index.php;
			#return 301 https://www.baidu.com;
			return 301 https://$server_name$request_uri;
		}
		
		location ~ \.php$ {
            root           F:\wordpressRun\zanglikun;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			#fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
   
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

     
    }
	
	server {
        listen       80;
        server_name  zanglikun.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   F:/wordpressRun/zanglikun;
            index  index.html index.htm index.php;
			# return 301 https://www.baidu.com;
		}
		
		location ~ \.php$ {
            root           F:\wordpressRun\zanglikun;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			#fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
   
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

     
    }
	
	
	server {
	    listen       443 ssl;
	    server_name  www.ff11sf.com;
	
	    ssl_certificate      ff11sf.com_bundle.crt;
	    ssl_certificate_key  ff11sf.com.key;
	
	    ssl_session_cache    shared:SSL:1m;
	    ssl_session_timeout  5m;
		
	    ssl_ciphers  HIGH:!aNULL:!MD5;
	    ssl_prefer_server_ciphers  on;
		
		location / {
            root   html;
            index  index.html index.htm index.php;
			if (-f $request_filename/index.html){
				rewrite (.*) $1/index.html break;
			}
			if (-f $request_filename/index.php){
				rewrite (.*) $1/index.php;
			}
			if (!-f $request_filename){
				rewrite (.*) /index.php;
			}
			
        }
		
		
		location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			#fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
	}
	
	server {
	    listen       443 ssl;
	    server_name  www.zanglikun.com;
	
	    ssl_certificate      zanglikun.com.crt;
	    ssl_certificate_key  zanglikun.com.key;
	
	    ssl_session_cache    shared:SSL:1m;
	    ssl_session_timeout  5m;
		
	    ssl_ciphers  HIGH:!aNULL:!MD5;
	    ssl_prefer_server_ciphers  on;
		
		location / {
            root   F:\wordpressRun\zanglikun;
            index  index.html index.htm index.php;
			if (-f $request_filename/index.html){
				rewrite (.*) $1/index.html break;
			}
			if (-f $request_filename/index.php){
				rewrite (.*) $1/index.php;
			}
			if (!-f $request_filename){
				rewrite (.*) /index.php;
			}
        }

		location ~ \.php$ {
            root           F:\wordpressRun\zanglikun;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			#fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
	}
	
	server {
	    listen       443 ssl;
	    server_name  www.newsglobal.cn;
	
	    ssl_certificate      newsglobal.cn.pem;
	    ssl_certificate_key  newsglobal.cn.key;
	
	    ssl_session_cache    shared:SSL:1m;
	    ssl_session_timeout  5m;
		
	    ssl_ciphers  HIGH:!aNULL:!MD5;
	    ssl_prefer_server_ciphers  on;
		
		location / {
            root   F:/wordpressRun/yanxinrui;
            index  index.html index.htm index.php;
			if (-f $request_filename/index.html){
				rewrite (.*) $1/index.html break;
			}
			if (-f $request_filename/index.php){
				rewrite (.*) $1/index.php;
			}
			if (!-f $request_filename){
				rewrite (.*) /index.php;
			}
        }

		location ~ \.php$ {
            root           F:/wordpressRun/yanxinrui;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			#fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
	}
	
	server {
	    listen       443 ssl;
	    server_name  www.zlk1999.xyz;
	
	    ssl_certificate      zlk1999.xyz.crt;
	    ssl_certificate_key  zlk1999.xyz.key;
	
	    ssl_session_cache    shared:SSL:1m;
	    ssl_session_timeout  5m;
		
	    ssl_ciphers  HIGH:!aNULL:!MD5;
	    ssl_prefer_server_ciphers  on;
		
		location / {
            root   F:/wordpressRun/zangwenshan;
            index  index.html index.htm index.php;
			if (-f $request_filename/index.html){
				rewrite (.*) $1/index.html break;
			}
			if (-f $request_filename/index.php){
				rewrite (.*) $1/index.php;
			}
			if (!-f $request_filename){
				rewrite (.*) /index.php;
			}
        }

		location ~ \.php$ {
            root           F:/wordpressRun/zangwenshan;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			#fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
	}
	
	
	
    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}
	
	
	
}
还是那句话,你只看到了大佬轻松解决问题的光鲜,却不记得当初人家死磕Bug的痛苦。

万物皆入轮回,谁也躲不掉!

以上文章,均是我实际体验,写出来的笔记资料,不会出现全文盗用别人文章!烦请各位,支持下原创,请勿直接盗用,有条件的可以开通个会员支持下,谢谢!!!

Java Code Study » 备份的Nginx 配置 可参考

招聘、单纯问问题,都可以联系我

加我QQ 公司缺人,拉我入伙