考勤机dmz服务器nginx转发代理配置
时间: 2023-05-24 18:04:18 浏览: 199
以下是考勤机dmz服务器nginx转发代理配置的示例:
1. 安装nginx并配置
sudo apt-get install nginx
sudo vi /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://10.0.0.5:8080;
proxy_set_header Host $http_host; # pass on original host
proxy_set_header X-Real-IP $remote_addr; # pass on user's IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # pass on user's IP
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
2. 重启nginx并测试
sudo systemctl restart nginx
打开浏览器并访问考勤机dmz服务器的IP地址,应该能够看到考勤系统的登录页面。
阅读全文
相关推荐
















