I don’t have any experience working with Linux. Now I tried to deploy ASP.NET Core 6 app on WSL with nginx. Working fine except one small issue. Response is not complete after sending 1500+ rows of html. Tbh response get stuck and only sometimes sending response. Then I disabled proxy buffering and caching from Nginx config and now seeing those 1500+ rows of incomplete html.
- 1500 lines roughly 70-80 KB.
- Running on WSL so localhost.
- Nginx version 18 and default config is there. I only created some config for test my applications. Taken from Microsoft official website for Asp.Net core deployment.
- Accessing Kestrel on 5000 port working just fine. But Nginx not working for said case.
- Nginx error log showing (111: Connection refused) while connecting to upstream AND (110: Connection timed out) while reading upstream.
- Kestrel does not have any error log, from DEBUG log it seems like its working and sending data. Application log showing accessing DB and sending data. Both Kestrel and Application log instantaneous.
- I have googled and tried almost everything. But as I said I don’t have any experience on Linux environment so it’s possible that I have missed something. Or did something wrong.
Here is configuration from Microsoft official site. I have added log and some directives I am tinkering with.
http {
map $http_connection $connection_upgrade {
"~*Upgrade" $http_connection;
default keep-alive;
}
server {
listen 80;
server_name example.com *.example.com;
location / {
proxy_pass http://127.0.0.1:5000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
I mostly focused on Nginx’s error log. So after googling I tried
- Checking folder permission
- Tinkering with some proxy config like proxy buffer, proxy cache etc.
- Deploying project with specifying 127.0.0.1 instead of localhost.
HonestJackfruit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.