ini 带有Homebrew的Mac OS X的Nginx配置,使用启用了站点的目录。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini 带有Homebrew的Mac OS X的Nginx配置,使用启用了站点的目录。相关的知识,希望对你有一定的参考价值。

    mkdir -p /usr/local/etc/nginx/sites-{enabled,available}

File locations:

* `nginx.conf` to `/usr/local/etc/nginx/`
* `default` and `default-ssl` to `/usr/local/etc/nginx/sites-available`
* `homebrew.mxcl.nginx.plist` to `/Library/LaunchDaemons/`
server {
    listen       80;
    server_name  localhost;

    #access_log  logs/host.access.log  main;

    location / {
        root   html;
        index  index.html index.htm;
    }

    #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   html;
    }
}
server {
    listen       443;
    server_name  localhost;

    ssl                  on;
    ssl_certificate      server.crt;
    ssl_certificate_key  server.key;

    ssl_session_timeout  5m;

    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;

    location / {
        root   html;
        index  index.html index.htm;
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>homebrew.mxcl.nginx</string>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <false/>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/opt/nginx/sbin/nginx</string>
        <string>-g</string>
        <string>daemon off;</string>
    </array>
    <key>WorkingDirectory</key>
    <string>/usr/local</string>
  </dict>
</plist>
#user  nobody;
worker_processes  1;

error_log  /Library/Logs/nginx/error.log;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /Library/Logs/nginx/access.log  main;

    sendfile        on;

    keepalive_timeout  65;

    index index.html index.php;
    
    upstream www-upstream-pool{
        server unix:/tmp/php-fpm.sock;
    }

    include /etc/nginx/conf.d/*.conf;
    include /usr/local/etc/nginx/sites-enabled/*; 
}

以上是关于ini 带有Homebrew的Mac OS X的Nginx配置,使用启用了站点的目录。的主要内容,如果未能解决你的问题,请参考以下文章

Mac上Homebrew的使用——Homebrew 使 OS X 更完整

Mac OS X 包管理工具 Homebrew 安装与使用

为 xampp 安装 homebrew mac os x

Homebrew OS X OpenCV - 在另一台 Mac 上运行时寻找 dylib

ruby nikto 2.1.5 for Mac OS X via Homebrew

Mac OS X 解决HomeBrew更新慢的问题