zoukankan      html  css  js  c++  java
  • 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;

            }

        }

  • 相关阅读:
    用mkdirs创建目录
    关于布局(Layout)的一切
    用HTTP操作和文件操作把网页下载到sd卡
    OpenStack计费项目Cloudkitty系列详解(一)
    OpenStack/Gnocchi简介——时间序列数据聚合操作提前计算并存储起来,先算后取的理念
    python-RabbitMQ
    1go基本语法
    openstack多region配置
    cinder 挂载卷和 iSCSI原理
    Host aggregate分区
  • 原文地址:https://www.cnblogs.com/zeopean/p/5244731.html
Copyright © 2011-2022 走看看