修改hosts文件模拟域名解析,Nginx反向代理实现二级域名转发

网友投稿 947 2022-09-10

修改hosts文件模拟域名解析,Nginx反向代理实现二级域名转发

修改hosts文件模拟域名解析,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;daemon on; events { worker_connections 1024;}{ include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$' # '"$"$ #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #开启gzip gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_1.1; gzip_comp_level 9; gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-application/javascript application/json; gzip_disable "MSIE [1-6]\."; gzip_vary on; server { listen 80; server_name localhost; #配置根目录 location / { proxy_pass } } server { listen 80; server_name xutongbao-; #配置根目录 location / { proxy_pass } } server { listen 80; server_name ice.xutongbao-; #配置根目录 location / { proxy_pass } } server { listen 80; server_name jenkins.xutongbao-; #配置根目录 location / { proxy_pass } } server { listen 80; server_name nginx.xutongbao-; #配置根目录 location / { proxy_pass } } server { listen 83; server_name nginx; #配置根目录 location / { #root html; root /temp; 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; } #首页重定向 location =/ { rewrite ^(.*)$ } #日志重定向 location =/myLog.log { rewrite ^(.*)$ } } # 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; # } #}}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Python【day 16-1】面向对象初识
下一篇:bat文件打包react项目
相关文章

 发表评论

暂时没有评论,来抢沙发吧~