nginx 充当代理服务


#user nobody;
worker_processes auto;
worker_rlimit_nofile 32768;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 20480;
}


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 {
# listen 80;
# server_name localhost;
#
# location / {
# root html;
# index index.html index.htm;
# }

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

# deny all;
#}
# }
server{
#resolver 114.114.114.114;
resolver 223.5.5.5;
resolver_timeout 30s;
listen 80;
proxy_connect;
proxy_connect_allow 443 80;
proxy_connect_connect_timeout 20s;
proxy_connect_read_timeout 20s;
proxy_connect_send_timeout 20s;
location / {
proxy_pass $scheme://$http_host$request_uri;
}
}

# 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;
# }
#}

}
posted @ 2023-09-04 12:22  已老  阅读(11)  评论(0编辑  收藏  举报