Hi guys
First of all, I am trying to configure the system to have a reverse proxy with nginx, After that I have to configure the ssl certificate with letsencrypt.
The problem is that I can't get nginx to do a proper redirect to Kestrel and the result I get is a error code 502 .
I attach my configuration files in case anyone has an idea of what could be going on
Thank you very much friends for the time
docker-compose
================
version: "3.8"
services:
nginx_demo:
container_name: nginx_demo
image: nginx:1.20.2-alpine
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- 80:80
restart: always
networks:
- nop450_demo
depends_on:
- nop450_web_demo
nop450_web_demo:
image: nopcommerceteam/nopcommerce:4.50.1
container_name: nop450_web_demo
# ports:
# - "80:80"
# - "5000:5000"
networks:
- nop450_demo
expose:
- 5000
volumes:
- $PWD/web/Themes:/app/Themes
- $PWD/web/Plugins:/app/Plugins
- $PWD/web/App_Data:/app/App_Data
depends_on:
- nop450_db_demo
nop450_db_demo:
image: mysql:5.7
container_name: nop450_db_demo
command: mysqld --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- $PWD/mysql:/var/lib/mysql
networks:
- nop450_demo
environment:
MYSQL_ROOT_PASSWORD: xxxxxxxxxxx
MYSQL_DATABASE: xxxxxxxxxx
MYSQL_USER: xxxxxxxxxxxx
MYSQL_PASSWORD: zxxxxxxxxxx
networks:
nop450_demo: null
nginx config
================
events {}
http {
upstream web_nop450_web_demo{
server nop450_web_demo:5000;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name viajesroxana.com;
location / {
proxy_pass http://web_nop450_web_demo;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $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;
}
}
}
appseting.json
==========
{
"ConnectionStrings": {
"ConnectionString": "server=xxxxxxxx;database=xxxxxxxx;allowuservariables=True;user id=xxxxxxxxxxxxxx;password=xxxxxxxxxxx",
"DataProvider": "mysql",
"SQLCommandTimeout": null
},
"AzureBlobConfig": {
"ConnectionString": "",
"ContainerName": "",
"EndPoint": "",
"AppendContainerName": true,
"StoreDataProtectionKeys": false,
"DataProtectionKeysContainerName": "",
"DataProtectionKeysVaultId": ""
},
"CacheConfig": {
"DefaultCacheTime": 60,
"ShortTermCacheTime": 3,
"BundledFilesCacheTime": 120
},
"CommonConfig": {
"DisplayFullErrorStack": false,
"UserAgentStringsPath": "~/App_Data/browscap.xml",
"CrawlerOnlyUserAgentStringsPath": "~/App_Data/browscap.crawlersonly.xml",
"UseSessionStateTempDataProvider": false,
"MiniProfilerEnabled": false,
"ScheduleTaskRunTimeout": null,
"StaticFilesCacheControl": "public,max-age=31536000",
"SupportPreviousNopcommerceVersions": true,
"PluginStaticFileExtensionsBlacklist": "",
"ServeUnknownFileTypes": false
},
"DistributedCacheConfig": {
"DistributedCacheType": "redis",
"Enabled": false,
"ConnectionString": "127.0.0.1:6379,ssl=False",
"SchemaName": "dbo",
"TableName": "DistributedCache"
},
"HostingConfig": {
"UseProxy": false,
"ForwardedProtoHeaderName": "",
"ForwardedForHeaderName": "",
"KnownProxies": ""
},
"InstallationConfig": {
"DisableSampleData": false,
"DisabledPlugins": "",
"InstallRegionalResources": true
},
"PluginConfig": {
"ClearPluginShadowDirectoryOnStartup": true,
"CopyLockedPluginAssembilesToSubdirectoriesOnStartup": true,
"UseUnsafeLoadAssembly": true,
"UsePluginsShadowCopy": true
},
"WebOptimizer": {
"EnableJavaScriptBundling": true,
"EnableCssBundling": true,
"JavaScriptBundleSuffix": ".scripts",
"CssBundleSuffix": ".styles",
"EnableCaching": true,
"EnableMemoryCache": true,
"EnableDiskCache": true,
"EnableTagHelperBundling": false,
"CdnUrl": null,
"CacheDirectory": "/app/wwwroot/bundles",
"AllowEmptyBundle": true,
"HttpsCompression": 2
}
}