imvkmark
11/5/2018 - 4:15 AM

nginx:config

域名重定向, Log, php,

server {
    listen 80;
    listen [::]:80;
    server_name dev.1dailian.com;
    index index.php index.html index.htm default.html default.htm default.php;
    root /data/workbench/www/1dailian/public;

    client_max_body_size 20M;

    # rewrite root domain to ssl url
    rewrite ^/$ https://dev.1dailian.com/ permanent;

    location ~ .*\.(php|php5)?$ {
        fastcgi_pass 127.0.0.1:9000;
        # fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
    }

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    access_log /data/workbench/logs/dailian_access.log;
    error_log /data/workbench/logs/dailian_error.log;
    
    # font, json support react fetch
    location ~* \.(eot|ttf|woff|woff2|json)$ {
        add_header Access-Control-Allow-Origin *;
    }
}