Nginx Reverse Proxy Returns a 405 status code workaround for post requests to HTML pages

Source: Internet
Author: User
Tags nginx reverse proxy

The implementation is as follows:

server {    listen80;    listen443 ssl;     server_namenirvana.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;}

Note: There are many workarounds, and I'm here to force the conversion of the request to get

Nginx Reverse Proxy Returns a 405 status code workaround for post requests to HTML pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.