nginx反向代理配置
设置一个新的xx.conf文件
upstream http_matrixtmp_ghs{
server xx.xx.xx.xx:8081 ;//内网服务器,做负载均时可设置权重
}
log_format http_matrixtmp_ghs '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server {
listen 80;//端口号
server_name matrix.ghs.net;//设置映射域名
location / {
proxy_pass http://http_matrixtmp_ghs;
proxy_set_header Host $host:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
#proxy_set_header Via "nginx";
}
access_log /data/server/nginx/logs/matrixtmp.ghs.net.log http_matrixtmp_ghs;
}