I have a NGINX setup serving a React app and an API on my local network, with a valid SSL certificate generated by letsencrypt.
My domain is provided by domain.com, I'm going to refer to it as mydomain.com
My App works perfectly on the host machine (my laptop at the moment), but when I try to open it on mobile (which is connected to the same network), it returns a 403 Forbidden error.
Is there a mistake in my configuration files somewhere or could you tell me what could cause this?
/etc/nginx/sites-enabled/mydomain.com
:
server {
server_name mydomain.com;
root /home/build;
index index.html index.htm;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
location /api {
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_set_header x-forwarded-proto https;
proxy_cache_bypass $http_upgrade;
}
location / {
try_files $uri $uri/ =404;
}
}
/etc/hosts
:
...
127.0.1.1 mydomain.com