Jump to content

Slow NGINX Reverse Proxy

Go to solution Solved by colonel_mortis,

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.

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

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P2 500GB (M.2)

SSD: Crucial BX500 1TB

HDD: Seagate ST2000DM001 2TB

HDD: Seagate Barracuda 4TB

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

Current Laptop:

Spoiler

Name: Lenovo ThinkBook 14 20SL003JUK

CPU: Intel i7-1065G7 @ 3GHz

Graphics: Intel Iris Graphics

RAM: 16GB DDR4 @ 2667MHz

SSD: 480GB Western Digital M.2

Secondary SSD: 240GB Adata SATA

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Headphones: Steelseries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

Link to comment
Share on other sites

Link to post
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

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

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P2 500GB (M.2)

SSD: Crucial BX500 1TB

HDD: Seagate ST2000DM001 2TB

HDD: Seagate Barracuda 4TB

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

Current Laptop:

Spoiler

Name: Lenovo ThinkBook 14 20SL003JUK

CPU: Intel i7-1065G7 @ 3GHz

Graphics: Intel Iris Graphics

RAM: 16GB DDR4 @ 2667MHz

SSD: 480GB Western Digital M.2

Secondary SSD: 240GB Adata SATA

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Headphones: Steelseries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

Link to comment
Share on other sites

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

×