Appearance
Reverse proxy website
Install Nginx on server
CentOS:
bash
yum -y update
yum install -y epel-release
yum install -y nginx
Ubuntu/Debian:
bash
apt update
apt install nginx -y
Create sublink conf for nginx /etc/nginx/conf.d/sublink.conf
server {
listen 443 ssl http2 so_keepalive=on;
listen [::]:443 ssl http2;
server_name domain.tld; # change this domain
index index.html;
root /var/www/html;
ssl_certificate /your/cert/domain.tld.crt; #change cert path
ssl_certificate_key /your/key/domain.tld.key; #change cert key path
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
location ^~ / {
proxy_ssl_server_name on;
#proxy_ssl_protocols TLSv1.3;
proxy_pass https://www.xmplus.dev; #Authorize domain website
proxy_set_header Host www.xmplus.dev; #Authorize domain
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
proxy_hide_header Upgrade;
#add_header X-Cache $upstream_cache_status;
}
}
systemctl restart nginx
systemctl enable nginx
systemctl status nginx