1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| // 先完成基本的数据库创建等操作 --------------------------------- //查看nginx配置文件路径 [root@cc2 api]# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
//nginx代理静态资源和端口转发 server { listen 8080; server_name ccdeweb.top; location / { index index.html; } location /api/ { proxy_pass http://127.0.0.1:3000/; #go会启动在3000端口上 } location ~ \.(html|js|css|png|jpg|jpeg|gif|ico|swf|webp|pdf|txt|doc|docx|xls|xlsx|ppt|pptx|mov|fla|zip|rar)$ { #静态资源 expires max; root /var/www/dingding; } }
|