My personal website has been extremely slow for only me and my network. If i connect to it via cellular data on my phone, or a laptop at another building, it is as fast as any other website, but when i connect from any device connected to the network that the website is running from, it takes from 0.3 seconds (normal time) to upwards of 3 minutes to load any page, but that 0.3 second load time only occurs once per session. Sometimes it doesnt load at all, and just times out.
my nginx.conf has been provided below:
# nginx.conf
worker_processes 5;
error_log logs/error.log;
pid logs/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
use poll;
accept_mutex on;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
include mime.types;
access_log logs/access.log;
keepalive_timeout 75s;
keepalive_requests 100000;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
client_max_body_size 100k;
proxy_read_timeout 1;
proxy_buffering off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
upstream files {
zone upstreams 64K;
server 127.0.0.1:2025 max_fails=1 fail_timeout=5s;
keepalive 2;
}
server {
#listen 80;
listen 443 ssl;
ssl_certificate C:/Certbot/live/website.gov/fullchain.pem;
ssl_certificate_key C:/Certbot/live/website.gov/privkey.pem;
server_name website.gov;
location /fs/ {
proxy_set_header Host $host;
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;
proxy_pass http://localhost:3000/;
}
location /files/ {
proxy_set_header Host $host;
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;
proxy_pass http://files/;
}
location / {
root html;
}
location /e/ {
add_header Content-Type text/plain;
return 200 $remote_addr;
}
location /movies/ {
alias E:/movies/;
autoindex on; #Show table of contents
autoindex_exact_size off; #Show file size
autoindex_localtime on; #Show file time
}
location /music/ {
alias E:/memes_and_dumb_garbage/private/music/;
autoindex on; #Show table of contents
autoindex_exact_size off; #Show file size
autoindex_localtime on; #Show file time
}
}
error_page 500 502 503 504 /50x.html;
}
most of these directives were provided by forums, as this problem has persisted for months now. i’ve researched into them, but i dont really have a good understanding of their importance or what scale they’re for, e.g tiny website with few visitors like mine, a moderately sized website like superuser.com, or a monolithic website like google.com
any help would be greatly appreciated. thanks
(edited to remove private info)