Created
January 9, 2019 06:45
-
-
Save ezirmusitua/d7f2381605b74bff462a6a662e9d1390 to your computer and use it in GitHub Desktop.
[Weixin mini-program api server verification nginx config] weixin mini program api server verification, #nginx #deploy #weixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name <api_server_name>; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name <api_server_name> | |
access_log /opt/sites/logs/<api_server_name>.access.log; | |
error_log /opt/sites/logs/<api_server_name>.error.log; | |
ssl_certificate /etc/letsencrypt/live/<api_server_name>/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/<api_server_name>/privkey.pem; | |
keepalive_timeout 120; | |
server_tokens off; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; | |
location = /<verification-file-name> { | |
root /opt/wxmp-verification; # put verification file here | |
try_files $uri /opt/wxmp-verification/<verification-file-name>; | |
} | |
location /quote-price { | |
proxy_pass http://localhost:3000; | |
proxy_redirect off; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment