Preface Because the mini program upload requires https, the server https uses the certificate generated by letsencrypt, but Alibaba Cloud OSS does not do https (too lazy to upload the certificate), so I thought of using Nginx proxy to forward the upload request. Nginx Configuration # HTTPS server # server { listen 443 ssl; server_name your.domain.name; ... location / { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $Host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For } location /oss { proxy_set_header Host drift-book-dev.oss-cn-shenzhen.aliyuncs.com; proxy_set_header Connection keep-alive; proxy_pass http://***.oss-cn-***.aliyuncs.com/; #proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } Here, the sub-path "/oss" is used as the forwarding path. proxy_pass specifies your Alibaba Cloud domain name. Remember to add a slash "/" at the end, otherwise the forwarding will fail. nginx configure proxy_pass proxy forwarding Assume the following four situations are accessed using http://192.168.1.1/proxy/test.html respectively. The first one: location /proxy/ { proxy_pass http://127.0.0.1/; } Proxy to URL: http://127.0.0.1/test.html The second type (compared to the first type, with one less / at the end) location /proxy/ { proxy_pass http://127.0.0.1; } Proxy to URL: http://127.0.0.1/proxy/test.html The third type: location /proxy/ { proxy_pass http://127.0.0.1/aaa/; } Proxy to URL: http://127.0.0.1/aaa/test.html The fourth type (compared to the third type, with one less / at the end) location /proxy/ { proxy_pass http://127.0.0.1/aaa; } Proxy to URL: http://127.0.0.1/aaatest.html The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: MySQL 5.7.17 installation and configuration method graphic tutorial (windows10)
>>: How to solve jQuery conflict problem
This article shares the specific code of the WeCh...
Redis is an open source NoSQL database written in...
Recently, I needed to test the zoom video confere...
1. What is SQL injection? Sql injection is an att...
01 The concept of parallel replication In the mas...
Elasticsearch is very popular now, and many compa...
1. Background Use LDAP to centrally manage operat...
1. Download MySQL database and install and config...
First of all, for security reasons, JavaScript ca...
Docker is a very popular container technology. Th...
This article shares the third article on how to u...
Refer to the official documentation here for oper...
The system environment is server2012 1. Download ...
need Add a paging bar, which can jump to the page...
Table of contents 1. Swap partition SWAP 1.1 Crea...