deploy-strapi-on-aws icon indicating copy to clipboard operation
deploy-strapi-on-aws copied to clipboard

nginx issue

Open devads opened this issue 6 years ago • 17 comments

Hi,

I tried to add nginx.conf to root folder on project but always got the default page of nginx, I tried to change root directory in /etc/nginx/sites-available/default but front is accessible but not admin :-(

Thanks,

devads avatar Apr 08 '19 14:04 devads

strapi-cms/nginx.conf is used to replace /etc/nginx/nginx.conf, which needs sudo privilege.

kenberkeley avatar Apr 08 '19 15:04 kenberkeley

Sorry, ok I replaced /etc/nginx/nginx.conf, it's working now !

devads avatar Apr 08 '19 16:04 devads

I think it's a nginx conf but now I got an error on each page : 502 Bad Gateway I use same nginx.conf as you, SSL certificate are OK

devads avatar Apr 09 '19 08:04 devads

Must be a server down, restart it!

kenberkeley avatar Apr 09 '19 08:04 kenberkeley

I mean Strapi, not Nginx

kenberkeley avatar Apr 09 '19 08:04 kenberkeley

Strapi servers are OK (prod, dev and staging) and I already tried to restart them pm2 list status online Thanks,

devads avatar Apr 09 '19 08:04 devads

Open the ports of the firewall, and visit them directly

kenberkeley avatar Apr 09 '19 09:04 kenberkeley

All ports of the firewall were already opened (for testing purpose)

devads avatar Apr 09 '19 09:04 devads

Can you access http://[ServerIP]:1337 1338 1339?

kenberkeley avatar Apr 09 '19 09:04 kenberkeley

not really indeed, but strapi service is OK

devads avatar Apr 09 '19 09:04 devads

Well...

kenberkeley avatar Apr 09 '19 09:04 kenberkeley

image

What have you done after this...

kenberkeley avatar Apr 09 '19 09:04 kenberkeley

Without ssl it was working, with SSL I got this 502 error. Anyway, I switched to d2c they got strapi stack hub :-)

Thanks anyway !

devads avatar Apr 09 '19 12:04 devads

Without ssl it was working, with SSL I got this 502 error. Anyway, I switched to d2c they got strapi stack hub :-)

Thanks anyway !

I'm running across the same issue. With SSL I get 502 Bad Gateway. I'm unable to access the Strapi process by IP & port directly to answer @kenberkeley's last question.

steveafrost avatar Jun 30 '19 22:06 steveafrost

Well, maybe there are updates from Strapi team that breaks everything.

kenberkeley avatar Jul 01 '19 02:07 kenberkeley

Yeah, lots of updates lately w/ beta coming out. I was eventually able to reach via IP & port (own mistake of not building for production) but the nginx config is still throwing 503 gateway errors. If I figure it out, I'll post back.

Thanks for the tutorial/walkthrough! Super helpful.

steveafrost avatar Jul 01 '19 02:07 steveafrost

@steveafrost PR is welcome

kenberkeley avatar Jul 01 '19 02:07 kenberkeley