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

CentOS7 installation GUI interface and remote connection implementation

Use the browser (webdriver)-based selenium techno...

CSS 3.0 text hover jump special effects code

Here is a text hovering and jumping effect implem...

JavaScript to implement the back to top button

This article shares the specific code for JavaScr...

Storage engine and log description based on MySQL (comprehensive explanation)

1.1 Introduction to storage engines 1.1.1 File sy...

How to elegantly implement WeChat authorized login in Vue3 project

Table of contents Preface Prepare Implementation ...

MySQL paging analysis principle and efficiency improvement

MySQL paging analysis principle and efficiency im...

Detailed explanation of Vue's calculated properties

1. What is a calculated attribute? In plain words...

Some small methods commonly used in html pages

Add in the <Head> tag <meta http-equiv=&q...

Overview of time configuration under Linux system

1. Time types are divided into: 1. Network time (...

Detailed explanation of this pointing problem in JavaScript function

this keyword Which object calls the function, and...

Introduction to Semantic HTML Tags

In the past few years, DIV+CSS was very popular in...

Summary of the characteristics of SQL mode in MySQL

Preface The SQL mode affects the SQL syntax that ...

Sample code for html list box, text field, and file field

Drop-down box, text field, file field The upper p...

Ubuntu compiles kernel modules, and the content is reflected in the system log

Table of contents 1.Linux login interface 2. Writ...