无标题文档
wdCP系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdCDN系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
wdOS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdDNS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
注册 发贴 提问 回复-必看必看 wddns免费智能 DNS 开通 本地或虚拟机使 用wdcp 一键包在mysql编 译时"卡住"
【300G高防】双线 无视攻击 wdcp官方技术支持/服务 阿里云8折优惠券 无敌云 腾讯云优惠中,现注册更有260代金额券赠送
返回列表 发帖
提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等

温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的

[求助] 为何一加载magento官方的conf文件nginx就无法重启

我在 domain.conf 中 include 官方的 conf 文件     根目录下的nginx.conf.sample 重启 nginx就无效 一恢复原来的就可以了
  1. ## Example configuration:
  2. # upstream fastcgi_backend {
  3. #    # use tcp connection
  4. #    # server  127.0.0.1:9000;
  5. #    # or socket
  6. #    server   unix:/var/run/php5-fpm.sock;
  7. #    server   unix:/var/run/php/php7.0-fpm.sock;
  8. # }
  9. # server {
  10. #    listen 80;
  11. #    server_name mage.dev;
  12. #    set $MAGE_ROOT /var/www/magento2;
  13. #    include /vagrant/magento2/nginx.conf.sample;
  14. # }
  15. #
  16. ## Optional override of deployment mode. We recommend you use the
  17. ## command 'bin/magento deploy:mode:set' to switch modes instead.
  18. ##
  19. ## set $MAGE_MODE default; # or production or developer
  20. ##
  21. ## If you set MAGE_MODE in server config, you must pass the variable into the
  22. ## PHP entry point blocks, which are indicated below. You can pass
  23. ## it in using:
  24. ##
  25. ## fastcgi_param  MAGE_MODE $MAGE_MODE;
  26. ##
  27. ## In production mode, you should uncomment the 'expires' directive in the /static/ location block

  28. root $MAGE_ROOT/pub;

  29. index index.php;
  30. autoindex off;
  31. charset UTF-8;
  32. error_page 404 403 = /errors/404.php;
  33. #add_header "X-UA-Compatible" "IE=Edge";

  34. # PHP entry point for setup application
  35. location ~* ^/setup($|/) {
  36.     root $MAGE_ROOT;
  37.     location ~ ^/setup/index.php {
  38.         fastcgi_pass   fastcgi_backend;

  39.         fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
  40.         fastcgi_param  PHP_VALUE "memory_limit=756M \n max_execution_time=600";
  41.         fastcgi_read_timeout 600s;
  42.         fastcgi_connect_timeout 600s;

  43.         fastcgi_index  index.php;
  44.         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  45.         include        fastcgi_params;
  46.     }

  47.     location ~ ^/setup/(?!pub/). {
  48.         deny all;
  49.     }

  50.     location ~ ^/setup/pub/ {
  51.         add_header X-Frame-Options "SAMEORIGIN";
  52.     }
  53. }

  54. # PHP entry point for update application
  55. location ~* ^/update($|/) {
  56.     root $MAGE_ROOT;

  57.     location ~ ^/update/index.php {
  58.         fastcgi_split_path_info ^(/update/index.php)(/.+)$;
  59.         fastcgi_pass   fastcgi_backend;
  60.         fastcgi_index  index.php;
  61.         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  62.         fastcgi_param  PATH_INFO        $fastcgi_path_info;
  63.         include        fastcgi_params;
  64.     }

  65.     # Deny everything but index.php
  66.     location ~ ^/update/(?!pub/). {
  67.         deny all;
  68.     }

  69.     location ~ ^/update/pub/ {
  70.         add_header X-Frame-Options "SAMEORIGIN";
  71.     }
  72. }

  73. location / {
  74.     try_files $uri $uri/ /index.php$is_args$args;
  75. }

  76. location /pub/ {
  77.     location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
  78.         deny all;
  79.     }
  80.     alias $MAGE_ROOT/pub/;
  81.     add_header X-Frame-Options "SAMEORIGIN";
  82. }

  83. location /static/ {
  84.     # Uncomment the following line in production mode
  85.     # expires max;

  86.     # Remove signature of the static files that is used to overcome the browser cache
  87.     location ~ ^/static/version {
  88.         rewrite ^/static/(version[^/]+/)?(.*)$ /static/$2 last;
  89.     }

  90.     location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
  91.         add_header Cache-Control "public";
  92.         add_header X-Frame-Options "SAMEORIGIN";
  93.         expires +1y;

  94.         if (!-f $request_filename) {
  95.             rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
  96.         }
  97.     }
  98.     location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
  99.         add_header Cache-Control "no-store";
  100.         add_header X-Frame-Options "SAMEORIGIN";
  101.         expires    off;

  102.         if (!-f $request_filename) {
  103.            rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
  104.         }
  105.     }
  106.     if (!-f $request_filename) {
  107.         rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
  108.     }
  109.     add_header X-Frame-Options "SAMEORIGIN";
  110. }

  111. location /media/ {
  112.     try_files $uri $uri/ /get.php$is_args$args;

  113.     location ~ ^/media/theme_customization/.*\.xml {
  114.         deny all;
  115.     }

  116.     location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
  117.         add_header Cache-Control "public";
  118.         add_header X-Frame-Options "SAMEORIGIN";
  119.         expires +1y;
  120.         try_files $uri $uri/ /get.php$is_args$args;
  121.     }
  122.     location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
  123.         add_header Cache-Control "no-store";
  124.         add_header X-Frame-Options "SAMEORIGIN";
  125.         expires    off;
  126.         try_files $uri $uri/ /get.php$is_args$args;
  127.     }
  128.     add_header X-Frame-Options "SAMEORIGIN";
  129. }

  130. location /media/customer/ {
  131.     deny all;
  132. }

  133. location /media/downloadable/ {
  134.     deny all;
  135. }

  136. location /media/import/ {
  137.     deny all;
  138. }

  139. # PHP entry point for main application
  140. location ~ (index|get|static|report|404|503|health_check)\.php$ {
  141.     try_files $uri =404;
  142.     fastcgi_pass   fastcgi_backend;
  143.     fastcgi_buffers 1024 4k;

  144.     fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
  145.     fastcgi_param  PHP_VALUE "memory_limit=756M \n max_execution_time=18000";
  146.     fastcgi_read_timeout 600s;
  147.     fastcgi_connect_timeout 600s;

  148.     fastcgi_index  index.php;
  149.     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  150.     include        fastcgi_params;
  151. }

  152. gzip on;
  153. gzip_disable "msie6";

  154. gzip_comp_level 6;
  155. gzip_min_length 1100;
  156. gzip_buffers 16 8k;
  157. gzip_proxied any;
  158. gzip_types
  159.     text/plain
  160.     text/css
  161.     text/js
  162.     text/xml
  163.     text/javascript
  164.     application/javascript
  165.     application/x-javascript
  166.     application/json
  167.     application/xml
  168.     application/xml+rss
  169.     image/svg+xml;
  170. gzip_vary on;

  171. # Banned locations (only reached if the earlier PHP entry point regexes don't match)
  172. location ~* (\.php$|\.htaccess$|\.git) {
  173.     deny all;
  174. }
复制代码

返回列表