Nginx proxy pass config

A simple config proxy pass with Nginx

  • Install Nginx first
  • Add new site domain with config below
sudo nano /etc/nginx/sites-available/

# Content

server {
  listen 80;
  # The host name to respond to

  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;


    # enable WebSockets
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

# Make alias and apply
sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
sudo nginx -t
sudo service nginx reload
  • Access to, server auto pass it to

Leave a Reply

Your email address will not be published.Required fields are marked *