admin 管理员组文章数量: 1184232
2024年1月17日发(作者:vue快速入门)
#pid logs/;events { worker_connections 20480;}http { include ; 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/ main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/ main; location / { root html; index ; } #error_page 404 /; # redirect server error pages to the static page / # error_page 500 502 503 504 /; location = / { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ .php$ { # proxy_pass 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 ; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root
# deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /.ht { # deny all; #} }server { resolver 8.8.8.8; listen 8080; location / { proxy_pass $http_host$request_uri; proxy_set_header HOST $http_host; proxy_buffers 256 4k; proxy_max_temp_file_size 0k; proxy_connect_timeout 30; proxy_send_timeout 60; proxy_read_timeout 60; proxy_next_upstream error timeout invalid_header http_502; }}server { listen 8443; # dns resolver used by forward proxying resolver 114.114.114.114; # forward proxy for CONNECT request proxy_connect; proxy_connect_allow 443 563; proxy_connect_connect_timeout 10s; proxy_connect_read_timeout 10s; proxy_connect_send_timeout 10s; # forward proxy for non-CONNECT request location / { proxy_pass $host; proxy_set_header Host $host; } } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias ; # location / { # root html; # index ; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate ; # ssl_certificate_key ;
mkdir -p /etc/systemd/system/e.d/cat /etc/systemd/system/e.d/[Service]Environment="HTTP_PROXY=192.168.0.15:8080"Environment="HTTPS_PROXY=192.168.0.15:8443"Environment="NO_PROXY=*.,."mkdir .dockercat .docker/{ "proxies": { "default": { "httpProxy": "192.168.0.15:8080", "httpsProxy": "192.168.0.15:8443", "noProxy": "*.,." } }}systemctl daemon-reloadsystemctl restart docker
版权声明:本文标题:nginx正向代理服务器搭建 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1705442005a484929.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论