First-Burst diagram
Because it is a beginner, the deployment of this interface is not easy, before the first step to get a this out
Dynamic no problem, and then static resources are not come out, got two hours without results, with regrets slept a sleep
Test 1:
server { a; / { /usr/myweb/wwwroot/; Proxy_pass http://localhost:5000; # just set the address port 1.1; Proxy_set_header Upgrade $http _upgrade; Proxy_set_header Connection Keep-alive; Proxy_set_header Host $host; Proxy_cache_bypass $http _upgrade; }
Viewing results 404
Test 2:
server { a; /usr/myweb/wwwroot/; / { proxy_pass http:///localhost:5000; # just set the address port 1.1; Proxy_set_header Upgrade $http _upgrade; Proxy_set_header Connection Keep-alive; Proxy_set_header Host $host; Proxy_cache_bypass $http _upgrade; }
View the results or 404
Because those who deploy. NET core on-line success seem to have not encountered the same situation, do not know what is going on, look at a lot of articles have no results
After the change of thinking, since. NET core does not, then check other Nginx+apache, Tomcat these, as long as the agent forwarding should have this situation?
Sure enough, I saw the word: static and dynamic resource separation, OK check the direction of things, because obviously my. NET core host is obviously unable to locate the static resources
Otherwise it will not get out of the way, then the dynamic and static resources separately processing should be possible, and then found this figure
Nginx-location Configuration Guide
Https://www.server110.com/nginx/201402/6372.html
I also wrote a paragraph
server { a; ~.* (js|css| svg) $ { /usr/myweb/wwwroot/; } / { proxy_pass http:///localhost:5000; # just set the address port 1.1; Proxy_set_header Upgrade $http _upgrade; Proxy_set_header Connection Keep-alive; Proxy_set_header Host $host; Proxy_cache_bypass $http _upgrade; }}
With a full of expectations to check again, the static resources to point a bit, hey, this js why is empty
Not to be able to deal with JS, no, you have to look at this file first
Oh, the original is an empty JS, the perfect solution.
Master don't squirt, younger brother Linux plus. NET Core Novice
. Net Core Deployment Centos7+nginx