url
nginx
this is the result of the request. It is found that the request address is still 127.0.0.1. Is there something wrong with it?
url
nginx
this is the result of the request. It is found that the request address is still 127.0.0.1. Is there something wrong with it?
location / {}
this rule, because there is no =
defined as an exact match, so the default fuzzy matching takes effect, and it is in front of it, and the priority is higher than / apis/
, so in fact, the apis rule will never be hit.
the solution is also easy, since your focus is on the apis rule, why put it behind? When configuring, you usually put /
at the end of . You only need it to protect the bottom when no other rules are hit. If you put it in front of you, it will be truncated. There is only one configuration item for
proxy?
what about other configurations?
you don't understand what a reverse proxy is. < del > in addition, is it 404 if you directly visit http://epc.epcooo.com:81/recommend.html?category=4? I think there seems to be no problem with the configuration < / del > other guys are right. Nginx matches from top to bottom, and the higher the priority is, the higher the priority is. You should just switch the positions of /
and / apis/
to the matching priority after
location. If you server_name localhost, and the following location / or / apis/ is like this, you will start with the first one to find it. No matter how you write url because it is a fuzzy match, if you want to match to apis, then location = / apis/ so that's fine
Previous: Files in node_modules cannot be introduced under ie, and file errors are reported in element ui.
Next: The package cannot be scanned when using idea development.
there is a problem when using nginx to configure the front and back end to separate items. The front end is done with react and the routing is in history mode. The nginx configuration is as follows: server { listen 8000; server_name test; ...
the server is the centos7.0 server component is nginx when configuring a reverse proxy, if you want to add this line in the red box, will report an error. How to solve this problem ...
after nginx sets the reverse proxy, the request shows Provisional headers are shown what to do ...
Front-end port nginx configuration server { listen 8000; -sharp server_name _; root home myftp dist; index index.html index.htm; location apis { rewrite ^.+apis ?(.*)$ $1 break; incl...
the proxy is used in the vue project. After build, the server on the configuration reported a 404 error, which should be caused by not being able to use the proxy of dev server. Configure how to use nginx, on the server to configure nginx to implement t...
centos,nginx configures the port. I really want to know the possible cause of this problem. Please ask the seniors to solve the problem ....
after being deployed a few days ago, the interfaces were all open, and then I didn t care. Today, suddenly 405, why did this happen? every time I configured nginx, I should not have done reload and restart. ...
server { listen 80; server_name localhost; -sharpcharset koi8-r; -sharpaccess_log logs host.access.log main; location { proxy_pass http: localhost:8080; } location apis { ...
during the deployment phase of the project, the front-end call interface is cross-domain. Should you set a reverse proxy on the web server or add cross-domain code on the server? which is better, or is there a better way? ...
vue uses history mode, refresh is always on the home page vue-router uses history mode. The server is configured according to the official website using nginx. Refresh will only return to the entrance . refresh is still on the original page ...
because the online environment of the company project is multiple regions, the request API at the front end and the configuration of some regions are different, so you need a unified configuration file to meet the different needs of each region. Currentl...
after installing verdaccio, use PM2 start verdaccio to report an error. The output of the log file is shown in the picture. After searching the Internet, it does not support es6. I don t know if any friends have encountered this problem. How to solve it...
after antPro is compiled, using the nginx agent, the nginx is configured as follows: server { listen 8080; server_name localhost; -sharpcharset koi8-r; -sharpaccess_log logs host.access.log main; ...
both front and back ends are on the same CVM. vue is deployed on nginx, using port 80 and port 8081 on springboot. After the project starts, both vue and backend interfaces can be accessed on my local computer. Sending post requests under the vue path ...