GraphQL学习、踩坑记录(二)
如果您发现本文排版有问题,可以先点击下面的链接切换至老版进行查看!!!
GraphQL学习、踩坑记录(二)
server {
listen 80;
server_name www.daozhao.com daozhao.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name www.daozhao.com daozhao.com;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
root /home/daozhao.com;
index index.html index.htm index.php;
ssl_certificate /home/ssl/www.daozhao.com.pem;
ssl_certificate_key /home/ssl/www.daozhao.com.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~ \.php$ {
root /home/daozhao.com;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/daozhao.com$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
都是在网上搜的,也不知道有没有不合理,等学习完了再优化吧。
自己还架设了node服务器,可以使用graphql,通过pm2启动服务,总之很爽。- 分类:
- 吐槽
更新时间:
相关文章
spa前端 + wordpress后台项目配置nginx实战和静态资源配置难点
现在将wordpress作为后台项目,自己用vue或者react做自己的前端的项目越来越多,虽然作为同一个对外的项目,实际上是有两个项目组成,那怎么去分配这两个项目的路由呢?哪部分走spa,哪部分走 阅读更多…
pm2管理node,运行 npm run server等命令
特别是现在很多SPA应用,比如VUE项目,我们在vps里面很可能需要使用 node src/index.js 这样运行: pm2 --name="graphql" star 阅读更多…
前端模拟后端接口进行调试之node+mysql篇
有时前端在开发过程中肯定是会跟后端联调的,但是如果此时后端可能没有开发好,或者因为其它优先级高的事情无法联调,又或者是前端需要确保当前项目无明显bug后着手开发其他项目。这个时候如果能模拟后端接口数据 阅读更多…
WordPress上传图片出现“图像后期处理失败,请将其缩小到2500像素并重新上传”
今天在上传图片的时候发现了这个报错“图像后期处理失败,请将其缩小到2500像素并重新上传”,如果是英文版的话,就会报错“Post-processing of the image failed. If 阅读更多…
用nginx架设wordpress提示上传文件失败,无权限
网上一般解决方案都只是简单说文件没有执行权限,需要设置为755权限。实际上在使用nginx来作为服务器来使用wordpress的时候,需要用到php-fpm来解析php,默认用户是apache,而我 阅读更多…
nginx开启https parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf
安装nginx,一般是安装在/usr/local/nginx nginx基本操作 cd /usr/local/nginx/sbin 启动 ./nginx 关闭 ./ngin 阅读更多…