Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Stentorian

Slow NGINX Reverse Proxy

A couple of things that I noticed in your config file are that proxy_cache_bypass $http_upgrade seems weird (but you don't seem to have proxy caching enabled in the first place so that shouldn't matter), and that your upstream seems to be on the same host as your nginx but you're using the public IP rather than localhost. If you change the proxy_pass IP to 127.0.0.1 instead, does that make any difference?

 

As a sanity check, what's the performance of skipping nginx and hitting the backend directly (either from your local machine or SSHed into that box), and of serving a static file directly from nginx (a 404 page works)? If there's a problem with the proxying specifically, the proxy request would be quite a bit longer than the sum of those two.

Recommended Posts

Posted · Original PosterOP

Hey, 

 

So I'm running NGINX on my VPS and I am experiencing really slow website loading times when loading a reverse proxy. I have tried running it with one virtual host and still experiencing bad load times.

 

The two main reverse proxies I'm experiencing it with are docker.benwhybrow.com (portainter) and mail.benwhybrow.com (roundcube).

 

This is my virtual host file for portainer: https://hasteb.in/jabinule.nginx

My virtual host file for roundcube: https://hasteb.in/xuvoruza.nginx

My nginx.conf file: https://hasteb.in/ihosecuv.shell

 

Any help would be much appreciated! 


Current PC: 

Spoiler

N/A (Too poor to afford one)

Current Laptop:

Spoiler

Name: HP ProBook 645 G1

CPU: AMD A8-5550M @ 3.1GHz

Graphics: Radeon HD 8550G 768MB

Mobo: Hewlett-Packard 1992

RAM: 8GB DDR3 @ 798MHz

SSD: 500GB WD Blue SSD

Other Gear:

Spoiler

Phone: Samsung S9 Plus (128GB)

Microphone: Kotion Each G2000

Headphones: Kotion Each G2000

Assistant: Amazon Echo 1st Gen - Black

Self Promo Links:

 

Link to post
Share on other sites
Posted · Best Answer

A couple of things that I noticed in your config file are that proxy_cache_bypass $http_upgrade seems weird (but you don't seem to have proxy caching enabled in the first place so that shouldn't matter), and that your upstream seems to be on the same host as your nginx but you're using the public IP rather than localhost. If you change the proxy_pass IP to 127.0.0.1 instead, does that make any difference?

 

As a sanity check, what's the performance of skipping nginx and hitting the backend directly (either from your local machine or SSHed into that box), and of serving a static file directly from nginx (a 404 page works)? If there's a problem with the proxying specifically, the proxy request would be quite a bit longer than the sum of those two.


HTTP/2 203

Link to post
Share on other sites
Posted · Original PosterOP
On 7/6/2020 at 1:53 PM, colonel_mortis said:

A couple of things that I noticed in your config file are that proxy_cache_bypass $http_upgrade seems weird (but you don't seem to have proxy caching enabled in the first place so that shouldn't matter), and that your upstream seems to be on the same host as your nginx but you're using the public IP rather than localhost. If you change the proxy_pass IP to 127.0.0.1 instead, does that make any difference?

 

As a sanity check, what's the performance of skipping nginx and hitting the backend directly (either from your local machine or SSHed into that box), and of serving a static file directly from nginx (a 404 page works)? If there's a problem with the proxying specifically, the proxy request would be quite a bit longer than the sum of those two.

Thank you! Changing it to 127.0.0.1 fixed the issue. I also removed the proxy_cache_bypass from the virtual host. It loads perfectly fine. Appreciate the help! Have a good day! 


Current PC: 

Spoiler

N/A (Too poor to afford one)

Current Laptop:

Spoiler

Name: HP ProBook 645 G1

CPU: AMD A8-5550M @ 3.1GHz

Graphics: Radeon HD 8550G 768MB

Mobo: Hewlett-Packard 1992

RAM: 8GB DDR3 @ 798MHz

SSD: 500GB WD Blue SSD

Other Gear:

Spoiler

Phone: Samsung S9 Plus (128GB)

Microphone: Kotion Each G2000

Headphones: Kotion Each G2000

Assistant: Amazon Echo 1st Gen - Black

Self Promo Links:

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×