nginx转发域名小记
使用nginx转发域名
配置如下:
server { listen 80; server_name git.louyifei.com; charset utf-8; access_log /var/log/nginx/git-access.log; error_log /var/log/nginx/git-error.log error; location / { proxy_pass http://47.98.177.157:8081/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 允许客户端请求的最大单文件字节数 client_max_body_size 1000m; # 缓冲区代理缓冲用户端请求的最大字节数, client_body_buffer_size 128k; } }
建议使用nginx容器部署项目。使环境更干净、统一。