• mac 下 nginx的安装


    1. 使用 brew 安装 nginx 

      brew install nginx 

    2.打开ngnix 

      sudo nginx 

      -- 重启ngnix

      ngnix -s reload

    3. 关于php  ,默认使用 mac 上的php ,先配置 ,再开启 php-fpm

      sudo cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf vim /private/etc/php-fpm.conf

      sudo  php-fpm

    4.找到 /usr/local/etc/nginx/nginx.conf , 配置虚拟主机(###|$$$ 根据主机而定)

    server {

            listen       80;

            server_name  www.####.com;

            root /Users/#####/$$$$$;

            index  index.html index.htm index.php;

     

            location / {

                root   html;

                index  index.html index.htm;

                if (!-e $request_filename) {

                    #rewrite ^/(.*)$ /index.php?$1 last;

                    rewrite "^/(.*)$" /index.php last; #这一条很重要

                }

                    rewrite ^/$/index.php last;

            }

                location ~ .*.php$

            {

                include fastcgi.conf;

                fastcgi_pass  127.0.0.1:9000;

                fastcgi_index index.php;

                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

                fastcgi_param   PATH_INFO      $fastcgi_path_info;

                include fastcgi_params;

                expires off;

            }

        }

  • 相关阅读:
    docker备忘录
    GUAVA-RateLimit
    JDK各版本发展史
    C++ 基础备忘录
    浅谈MES
    MES在流程和离散制造企业的15个差别!
    mysql连接oracle补偿方案—odbc驱动
    WinForm控件Chart的图表类型
    C#的异常处理机制(try...catch...finally)
    oracle 横向列变为纵向列
  • 原文地址:https://www.cnblogs.com/zeopean/p/5244731.html
Copyright © 2020-2023  润新知