Problem description
After the introduction of spring security, there is no problem using Vue proxy locally. There is a problem using nginx. The problem is located in the nginx configuration
Solution:
# rewrite ^(/api/?.*)$ /$1 break; // old
rewrite ^/api/(.*)$ /$1 break; // modified
Explanation
take blog.lhuakai.top/api/getxxx
as an example
nginx
found /API
, replaced the match to /api.getxxx/
with $1 (the content in the first group) getxxx
and finally became blog.lhuakai.top/getxxx
Read More:
- Push to origin/Master was rejected [How to Solve]
- Nginx, which is suitable for front-end H5 requests, routes and forwards according to the URL and cuts the URL
- Nginx routes and forwards according to the URL and cuts the URL
- Grep: How to Find All the Files Containing a String in Linux
- Git Push Error: error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
- [Solved] Ubuntu tab Error: _complete:96: bad math expression: operand expected at end of string
- [Solved] gnutls_handshake() failed: The TLS connection was non-properly terminated
- [Solved] Linux SSH Login Terminal Error: shell request failed on channel 0
- [Solved] yocto Compile Error: ERROR: libtinyxml2-XXX do_fetch: Fetcher failure for URL
- [Solved] Git Error: OpenSSL SSL_read: Connection was reset, errno 10054和Failed to connect to github.com port 443
- [Solved] Web server failed to start. Port 8080 was already in use.
- Git Clone Error: ‘fatal: HTTP request failed‘
- [Solved] Compose error “HTTP request took too long to complete“
- [Solved] Linux C++ warning: ISO C++ forbids converting a string constant to ‘char*‘ [-Wwrite-strings]
- [Solved] minio Failed to Upload File Error: The difference between the request time and the server‘s time is too large.
- [Solved] error: ‘QStringLiteral’ was not declared in this scope
- Error: error from slirp4netns while setting up port redirection: map[desc:bad request: add_hostfwd:
- [Solved] dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
- [Solved] Log Error: kernel: blk_update_request: I/O error, dev fd0, sector 0
- Ansible Use yum module to install rpm Error: Request failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate v