System Information
- Strapi Version: 4.8.2
- Operating System: Linux / CentOS 7
- Database: Postgres
- Node Version: 14.21.3
- NPM Version: 6.14.18
- Yarn Version: 1.22.19
I’m configuring strapi using Nginx on CentOS7, I’ve successful on config reverse proxy and my domains work. However, when I get in strapi dashboard, my locales API(/i18n/locales) got 502 and it break the application, I’ve tried again with my IP address (IP:port/admin) and this API works normally, any idea?
type or paste code here
My Nginx configuration:
server {
if ($host = mydomain.com) {
return 301 $host$request_uri;
} # managed by Certbot
# Listen HTTP
listen 80;
listen [::]:80;
server_name mydomain.com www.mydomain.com;
root /my-backend/build/index.html;
# Redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}
server {
# Listen HTTPS
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
server_name mydomain.com www.mydomain.com;
root /my-backend/build/index.html;
# SSL config
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem; # managed by Certbot
# Proxy Config
location / {
proxy_pass myip:3000;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $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_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass_request_headers on;
}
location /admin {
proxy_pass myip:1337/admin;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $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_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass_request_headers on;
}
}
---