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

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

#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"';
    #access_log  logs/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  65;
    #gzip  on;
    server {
    resolver dns ip;
    resolver_timeout 5s;
    listen 0.0.0.0:80;
        #listen       80;
        #server_name  localhost;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
                proxy_pass $scheme://$host$request_uri;
access_log off;
        root   html;
            index  index.html index.htm;
        }
        #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;
    #    server_name  localhost;
    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;
    #    ssl_session_timeout  5m;
    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers   on;
    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}
}

转载地址:http://vxynm.baihongyu.com/

你可能感兴趣的文章
创建一个git仓库
查看>>
理解爬虫原理
查看>>
Linux 多线程
查看>>
iOS“.NET研究”平台应用开发的敏捷设计流程
查看>>
sqlite数据库中自增key的设定,autoincrement 和 rowid
查看>>
【推荐】10款优秀的jQuery图片插件
查看>>
黑帽大会:SCADA系统安全就像一颗“定时炸弹”
查看>>
20165303第九周学习总结
查看>>
sql存储过程中的整形变量和字符串变量
查看>>
WebService 调用三种方法
查看>>
自定义web框架
查看>>
java集合架构(二)——Map
查看>>
课堂实验
查看>>
The King’s Ups and Downs
查看>>
JRadioButton 实现图片切换
查看>>
图片和字符串相互转换
查看>>
动态规划,Dijkstra算法,A*算法的比较
查看>>
[笔记]sql server 单用户切换
查看>>
ios专题 - 图片(UIImage)获取方法
查看>>
iOS应用性能调优的25个建议和技巧
查看>>