### ~~Nginx Rewrite配置(1.1.3版后无需配置)~~
* 如果使用Nginx,请在server{}中添加一下配置,并重新加载下Nginx配置文件;
```
location /addons/zjhj_wdds/core/ {
if (!-e $request_filename) {
rewrite ^/addons/zjhj_wdds/core/(.*)$ /addons/zjhj_wdds/core/index.php?s=$1 last;
break;
}
}
```
---
### ~~Nginx 完整参考配置(1.1.3版后无需配置)~~
```
server
{
listen 80;
listen 443 ssl http2;
server_name www.hjwdds.me;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/www.hjwdds.me;
#error_page 404/404.html;
#SSL-START
ssl_certificate /etc/www.hjwdds.me/fullchain.pem;
ssl_certificate_key /etc/www.hjwdds.me/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497 https://$host$request_uri;
#SSL-END
#ERROR-PAGE-START
error_page 404 /404.html;
error_page 502 /502.html;
#ERROR-PAGE-END
# 注意这里,小程序接口基于ThinkPHP开发,需要做Rewrite
location /addons/zjhj_wdds/core/ {
if (!-e $request_filename) {
rewrite ^/addons/zjhj_wdds/core/(.*)$ /addons/zjhj_wdds/core/index.php?s=$1 last;
break;
}
}
location ~ [^/]\.php(/|$){
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi-71.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$
{
expires 12h;
access_log off;
}
access_log /www/wwwlogs/www.hjwdds.me.log;
}
```
---
### Nginx命令参考
* 检查配置文件语法是否正确;
```
nginx -t
```
* 重载Nginx配置文件;
```
nginx -s reload;
```