zoukankan      html  css  js  c++  java
  • Ngnix配置

      

    server {
      listen 80;
      server_name www.local.test;
      root /data/workspace; 
      index index.php index.html index.htm;

      error_page 404 502 503 =200 /index.html;

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

      location ~ .php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass 127.0.0.1:9000;
        #fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        try_files $uri =404;
      }

      location ~ /.(ht|svn|git) {
        deny all;
      }
    }

    • fastcgi_pass  #用来指定php-fpm监听的地址或者socket
    • fastcgi_index index.php  #设定访问根目录默认去找的文件
    • fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name  #设置访问根目录时默认寻找的文件

    修改完成后

    测试nginx配置是否正确: /usr/local/nginx/sbin/nginx -t

    平滑重启nginx服务: /usr/local/nginx/sbin/nginx -s reload

  • 相关阅读:
    Git
    Entropy, relative entropy and mutual information
    2021.5.3 团队冲刺第六天
    2021.5.2 团队冲刺第五天
    2021.5.1 团队冲刺第四天
    2021.4.30 团队冲刺第三天
    2021.4.29 团队冲刺第二天
    2021.4.28 团队冲刺第一天
    2021.4.27
    2021.4.26
  • 原文地址:https://www.cnblogs.com/starfish29/p/10569962.html
Copyright © 2011-2022 走看看