博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
我的 nginx 配置
阅读量:4963 次
发布时间:2019-06-12

本文共 6146 字,大约阅读时间需要 20 分钟。

#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;    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '    #                  '$status $body_bytes_sent "$http_referer" '    #                  '"$http_user_agent" "$http_x_forwarded_for"';        log_format abc "$remote_addr|$remote_user|$time_local|$request_method|$uri|$args|$request_body|$server_protocol"                   "|$status|$body_bytes_sent|$upstream_addr|$upstream_cache_status|$upstream_status"                   "|$http_x_forwarded_for|$http_host|$http_user_agent|$upstream_response_time|$request_time";    access_log  logs/access.log  abc;    sendfile        on;    #tcp_nopush     on;    #keepalive_timeout  0;    keepalive_timeout  65;    #gzip  on;    upstream carplay_dynamic{      server 192.168.10.198:8080;    }    upstream monitor{      server 192.168.10.198:8080;    }    upstream officedyanmic{      server 192.168.10.139:8080;    }    upstream otcdyanmic{#    server 192.168.10.133:8888;#       server 10.0.0.2:8888;#    server 192.168.10.21:8088;#    server 192.168.10.103:8888;#    server 192.168.10.100:8888;#       server 10.0.0.1:8888;#       server 2.0.0.1:8888;    server 192.168.10.149:8888;            }    upstream  repair-master{    #server 192.168.10.21:8081;        server  192.168.10.56:8081;    }    upstream pmc{        server www.ancenn.com;    #server 192.168.10.89:8080;    #server 192.168.10.89:8081;    #server 192.168.10.21:6182;    #server 192.168.10.132:8080;        #server  192.168.10.133:8080;        #server  192.168.10.56:8102;    }    upstream jk-site{        server   192.168.10.100:9090;          #server  192.168.10.106:9090;         #server  192.168.10.56:8102;         #server  10.0.0.1:9090;        #server  10.0.0.2:9090;        #server  192.168.10.125:9090;    }    server {        listen       80;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location /carplay_dynamic {            proxy_pass http://carplay_dynamic;        }    location /otcdyanmic {            proxy_pass http://otcdyanmic;        }    location /officedyanmic{            proxy_pass http://officedyanmic;        }    location /monitor {            proxy_pass http://monitor;        }        location /repair-master {            proxy_pass http://repair-master;        }        location /jk-site{            proxy_pass http://jk-site;            access_log  logs/host.access.log  abc;        }        location / {            ssi    on;            ssi_silent_errors on;            root   html;            index  index.html index.htm;            access_log  logs/host.access.log  abc;        }     location /pmc {            proxy_pass http://pmc;        }                             #error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000        #        #location ~ \.php$ {        #    root           html;        #    fastcgi_pass   127.0.0.1:9000;        #    fastcgi_index  index.php;        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;        #    include        fastcgi_params;        #}        # deny access to .htaccess files, if Apache's document root        # concurs with nginx's one        #        #location ~ /\.ht {        #    deny  all;        #}    }    # 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;    #    }    #}         server {        listen       8082;        server_name  localhost 192.168.10.102 192.168.11.117 192.168.43.53 192.168.0.8;        #charset koi8-r;        #access_log  logs/host.access.log  main;    error_log nginx_error.log debug;        location / {        root   D:/project/digital/digitalcampusweb;            #root   /Users/shuwenjie/tellco/projects/zhidong1/digitalcampusweb;            index  index.html index.htm;        client_max_body_size 1000000m;        }        location /api/ {            proxy_pass http://192.168.10.100:9880/api/;#立群电脑            #proxy_pass http://192.168.10.104:9880/api/;#火林电脑        #proxy_pass http://192.168.11.131:8090/api/; #与存电脑            #proxy_pass http://192.168.10.221:8081/api/;        #proxy_pass http://xpg-test.jxszxy.cn/api/;            client_max_body_size 1000000m;        }                location /hub/ {            proxy_pass http://192.168.10.221:8081/dc-sso/;        }        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }    }}

 

<!-- <include src="public/Header.html"></include> -->

<!-- <include src="public/Footer.html"></include> -->
Nginx配置SSI
如何在nginx上配置SSI
需要的选项主要是以下三个:
ssi: 默认值off,启用ssi时将其设为on
ssi_silent_errors: 默认值off,开启后在处理SSI文件出错时不输出错误提示"[an error occurred while processing the directive]"。
ssi_types: 默认是text/html,所以如果需支持html,则不需要设置这句,如果需要支持shtml则需要设置:ssi_types text/shtml
三个参数可以放在http, server或location作用域下。

转载于:https://www.cnblogs.com/webqiand/articles/11250095.html

你可能感兴趣的文章
【设计模式】工厂模式
查看>>
两个表格中数据不用是一一对应关系--来筛选不同数据,或者相同数据
查看>>
客户数据库出现大量cache buffer chains latch
查看>>
機械の総合病院 [MISSION LEVEL: C]
查看>>
实战练习细节(分行/拼接字符串/字符串转int/weak和copy)
查看>>
Strict Standards: Only variables should be passed by reference
查看>>
hiho_offer收割18_题解报告_差第四题
查看>>
AngularJs表单验证
查看>>
静态方法是否属于线程安全
查看>>
02号团队-团队任务3:每日立会(2018-12-05)
查看>>
SQLite移植手记1
查看>>
js05-DOM对象二
查看>>
mariadb BINLOG_FORMAT = STATEMENT 异常
查看>>
C3P0 WARN: Establishing SSL connection without server's identity verification is not recommended
查看>>
iPhone在日本最牛,在中国输得最慘
查看>>
动态方法决议 和 消息转发
查看>>
js 基础拓展
查看>>
C#生成随机数
查看>>
Android应用程序与SurfaceFlinger服务的连接过程分析
查看>>
Java回顾之多线程
查看>>