Question
Proxying nginx to port 1337 with Strapi
Trying to make a proxy from domain: api.example.com to api.example.com:1337. The proxy is working sort of. If I use port 3000 (which is my main site) it all works, just not on 1337.
I have initialised the strapi-app with “yarn build”, and using pm2 to continuing run Node. Also making sure that port 1337 is allowed in the firewall.
Can anyone possible guess what the issue might be? I have tried almost everything I can think of :-)
This is my nginx configuration:
server {
index index.html;
server_name api.example.com;
location / {
proxy_pass http://api.example.com:1337;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
My ufw firewall settings:
To Action From
-- ------ ----
1337/tcp ALLOW Anywhere
1337 ALLOW Anywhere
1337/tcp (v6) ALLOW Anywhere (v6)
1337 (v6) ALLOW Anywhere (v6)
Strapi-app structure:
someuser@someuser-website:~/api$ ls
README.md api build config extensions favicon.ico node_modules package.json public yarn.lock
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×