# wechat-access_token **Repository Path**: johnsong2016/wechat-access_token ## Basic Information - **Project Name**: wechat-access_token - **Description**: nodejs for wechat access_token server - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-10-15 - **Last Updated**: 2022-06-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README nodejs access_token中控安装 ******************************** 需要域名:access.example.com 需要https 需要redis为该nodejs server独享 ******************************** 一、环境 1. nodejs LTS最新版 官网地址:https://nodejs.org/en/ 二进制下载地址:https://nodejs.org/dist/v8.12.0/node-v8.12.0.tar.gz 2. redis v4.0.11版本 下载地址:http://download.redis.io/releases/redis-4.0.11.tar.gz 3. nginx 1.15.5版本 下载地址:https://nginx.org/download/nginx-1.15.5.tar.gz 二、安装步骤 1. 安装依赖 运行命令 npm install 安装依赖(可能需要sudo) 2. 启动redis服务 3. nginx 配置,参照修改 server { listen 443 ssl http2; server_name access.example.com; rewrite ^(.*) https://$http_host$request_uri? permanent; ssl_certificate /Users/johnsong/localhost.crt; ssl_certificate_key /Users/johnsong/localhost.key; keepalive_timeout 70; location /cgi-bin { proxy_pass http://127.0.0.1:3001; #和nodejs .env里面的配置相对应 proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } 4. 修改.env配置,修改redis地址和端口,设置nodejs server运行的地址和端口 5. 修改package.json 里面的内容 将 nodemon 改成 node(如果已经是node请忽略) 6. 启动nodejs server服务 运行命令 npm start启动nodejs server服务(可能需要sudo) 7. 启动nginx服务