I have set up a Nginx web server on my raspberry pi and CAN access it from outside of the network that it is located on (such as school/work) but not from home. There is the same problem on all the computers on my home network so it's not my host's file.
nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 127.0.0.1:80;
listen 192.168.1.9:80;
server_name tasty.zapto.org www.tasty.zapto.org;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
listen 127.0.0.1:443 ssl default_server;
listen 192.168.1.9:443 ssl default_server;
server_name tasty.zapto.org www.tasty.zapto.org;
#config to enable HSTS
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains;";
ssl_certificate /etc/letsencrypt/live/tasty.zapto.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/tasty.zapto.org/privkey.pem;
root /data/tasty.zapto.org/www;
index index.php index.html index.htm;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/tasty.zapto.org/www;
}
# Error & access logs
error_log /data/tasty.zapto.org/logs/error.log error;
access_log /data/tasty.zapto.org/logs/access.log;
location / {
index index.php index.html;
}
location ~ /.well-known {
allow all;
}
location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}