Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

nginx Reverse Proxy

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
trcalls
Posts: 1
Joined: Tue Apr 04, 2017 4:57 pm

nginx Reverse Proxy
  • Quote

Post by trcalls » Tue Apr 04, 2017 5:15 pm

Hi,

I am attempting to move my dev site into a fresh install of vestacp. The frontend of my website is a wordpress blog, and the webapp side is written as a nodejs app. In my previous environment (without vestacp), I was easily able to set up the following configurations in nginx.conf:

Code: Select all

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  mydomain.com;
        root         /usr/share/nginx/html;

        expires $expires;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        # Security Implementations for node...
        add_header X-Frame-Options SAMEORIGIN;
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        # add_header Content-Security-Policy "default-src 'self' style-src 'self' 'unsafe-inline'";

        # Hide "powered by" line in headers.  So people can't see what software we're running to serve page content
        proxy_hide_header X-Powered-By;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        # Hide version numbers in error messages and headers
        server_tokens off;

        location /app {
                proxy_pass http://localhost:5000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_set_header X-Real-IP $remote_addr;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

         location /dev {
                proxy_pass http://localhost:6000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_set_header X-Real-IP $remote_addr;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

        location /dl {
                alias /usr/share/nginx/html/dl;
        }


        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
I have tried to replicate the configuration within vestacp's advanced configuration area. However, when I navigate to http://mydomain.com/app I get a simple Wordpress 404 error.

Is there something obvious I'm doing wrong? Or is there a better way to go about doing this?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: nginx Reverse Proxy
  • Quote

Post by skurudo » Wed Apr 05, 2017 6:49 am

nginx error logs don't say anything?

or you can try something like

Code: Select all

location /dev/
or

Code: Select all

location ^~ /dev/ 
Top

orgolan
Posts: 8
Joined: Sat Apr 25, 2020 7:32 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: nginx Reverse Proxy
  • Quote

Post by orgolan » Tue Apr 28, 2020 10:48 am

hi,
can you post your solution?
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password