Nginx Rewrite to Internal Server

nginx Dec. 22, 2015, 9:25 p.m.

server {
listen 80; ## listen for ipv4; this line is default and implied

        access_log   /var/log/nginx/default.access.log;
        error_log    /var/log/nginx/;
    location ~ ^/(.*)$ {
            proxy_set_header   Host;
            proxy_set_header  X-Real-IP  $remote_addr;


I have multiple website on my different VM and I want to make it accesible from  outside without moving to my webserver, after a few trial and errors, I used this code as my nginx setting.

Any thoughts?