Solution to the problem of two slashes // appearing after the domain name when nginx is configured for domain name access

Solution to the problem of two slashes // appearing after the domain name when nginx is configured for domain name access

I rewrote my personal website recently. I bought a new server on Alibaba Cloud. After configuring it, a problem occurred. After entering the domain name, the domain name address will automatically add two slashes at the end.

And the website is still not accessible. After carefully observing the nginx configuration, I found the following

Solution

We should add a / after the path in nginx configuration

After configuration is complete

Save and Restart

No problem visiting again

Attached configuration file

server {
    listen 80;
    server_name wx.pyxrsj.cn;
    include /etc/nginx/default.d/*.conf;

    location / {
       proxy_pass http://localhost:8080/pyrsfw/; ####This / must be added with index index.html index.htm index.jsp;
    }
    location ^~/wxapi/ {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass http://localhost:8888/; ####This / must be added}

     error_page 404 /404.html;
      location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
      location = /500.html {
    }
   }

This is the end of this article about the solution to the problem of two slashes // after the domain name when configuring nginx domain name access. For more relevant content about two slashes after the nginx domain name, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of the murder caused by a / slash in Nginx proxy_pass
  • Problems with nginx URLs automatically adding slashes and 301 redirects
  • How to solve the problem of WordPress path not automatically adding slashes in Nginx server
  • Solution to Nginx backslash automatic decoding problem
  • Detailed explanation of slash (/) in nginx

<<:  MySQL 5.7.30 Installation and Upgrade Issues Detailed Tutorial

>>:  The perfect solution for Vue routing fallback (vue-route-manager)

Recommend

In-depth analysis of the diff algorithm in React

Understanding of diff algorithm in React diff alg...

How to view the type of mounted file system in Linux

Preface As you know, Linux supports many file sys...

Vue uses vue meta info to set the title and meta information of each page

title: vue uses vue-meta-info to set the title an...

How to monitor global variables in WeChat applet

I recently encountered a problem at work. There i...

Detailed explanation of nginx shared memory mechanism

Nginx's shared memory is one of the main reas...

The most comprehensive explanation of the locking mechanism in MySQL

Table of contents Preface Global Lock Full databa...

How to install FastDFS in Docker

Pull the image docker pull season/fastdfs:1.2 Sta...

Detailed deployment of Alibaba Cloud Server (graphic tutorial)

I have recently learned web development front-end...

Several popular website navigation directions in the future

<br />This is not only an era of information...

Detailed explanation of various join summaries of SQL

SQL Left Join, Right Join, Inner Join, and Natura...

Explanation of building graph database neo4j in Linux environment

Neo4j (one of the Nosql) is a high-performance gr...

Create a custom system tray indicator for your tasks on Linux

System tray icons are still a magical feature tod...