抖店云的虚机用Nginx代理解码抖店订单
安装ngnix:略
配置nginx:
# cat /etc/nginx/nginx.conf
user nginx;
worker_processes 8;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 65535;
}
http {
log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
#gzip on;
proxy_buffering off;
proxy_buffer_size 128k;
proxy_buffers 100 128k;
client_max_body_size 1024m;
upstream doudianapi {
server openapi-fxg.jinritemai.com:443;
}
log_format upstream_info ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$upstream_addr” ‘
‘$upstream_response_time $request_time’;
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name doudian.yunbu.me;
ssl_certificate “/etc/nginx/cert/yunbu.me_bundle.crt”;
ssl_certificate_key “/etc/nginx/cert/yunbu.me.key”;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-SHA256:AES256-SHA256;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
# Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
location / {
proxy_http_version 1.1;
proxy_pass https://openapi-fxg.jinritemai.com;
proxy_ssl_server_name on;
proxy_set_header Host openapi-fxg.jinritemai.com;
proxy_set_header User-Agent $http_user_agent;
access_log /var/log/nginx/access.log upstream_info;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
启动:
systemctl start nginx
注意:安全组开放443端口