How to solve the problem that NGINX reverse proxy returns 405 for POST request of HTML page

王林
Release: 2023-05-22 19:49:04
forward
2545 people have browsed it

The implementation is as follows:

server {
    listen	80;
    listen	443 ssl;
    server_name	nirvana.test-a.gogen;

    ssl_certificate      /etc/nginx/ssl/nirvana.test-a.gogen.crt;
    ssl_certificate_key  /etc/nginx/ssl/nirvana.test-a.gogen.key;

    proxy_connect_timeout 600;
    proxy_read_timeout 600;
    proxy_send_timeout 600;

    client_max_body_size 10m;

    #error_page 405 =200 /ding/face_matching.html;

    location / {
        proxy_pass http://nirvana-server-a;
        proxy_next_upstream http_500 http_502 http_503 error timeout invalid_header;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }

    location ~.*\.(html|css|js|jpg|json|png|map|\ttf*|\woff2*|\woff*|eot|otf|ttf|json|cur|woff|svg|woff2|m3u8|ts|mp3)$ {
        proxy_method GET;
        proxy_pass http://nirvana-browser-a;
        proxy_next_upstream http_500 http_502 http_503 error timeout invalid_header;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
    access_log  /var/log/nginx/nirvana-test-a.log  main;
}
Copy after login

The above is the detailed content of How to solve the problem that NGINX reverse proxy returns 405 for POST request of HTML page. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!