Skip to content

Instantly share code, notes, and snippets.

@tknzk
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save tknzk/7bdc8e2e240e05ac6da0 to your computer and use it in GitHub Desktop.

Select an option

Save tknzk/7bdc8e2e240e05ac6da0 to your computer and use it in GitHub Desktop.

Revisions

  1. tknzk revised this gist Feb 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion yapani.com.conf
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@ server {
    # fastcgi_pass_header "X-Accel-Expires";
    #}

    root /var/www/com.yapani/wp;
    root /var/www;
    index index.html index.htm index.php;

    # Make site accessible from http://localhost/
  2. tknzk created this gist Feb 9, 2015.
    88 changes: 88 additions & 0 deletions yapani.com.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,88 @@
    upstream backend {
    server 127.0.0.1:8080;
    }


    server {
    listen 80;
    server_name _;

    #access_log /var/log/nginx/access_80.log main;
    access_log /var/log/nginx/access_80.log;

    location = /favicon.ico {
    log_not_found off;
    }

    location /wp-admin {
    proxy_pass http://backend;
    }

    location /wp-login.php {
    proxy_pass http://backend;
    }

    #location = / {
    # rewrite ^(.+)$ /index.php;
    #}

    location = /wp-admin {
    rewrite ^(.+)$ /wp-admin/index.php;
    }

    location / {
    proxy_pass http://backend;
    proxy_no_cache $do_not_cache;
    proxy_cache_bypass $do_not_cache;
    proxy_cache zone1;
    proxy_cache_key $scheme$proxy_host$uri$is_args$args;
    proxy_cache_valid 200 1d;

    if ($http_user_agent ~* '(DoCoMo|UP.Browser|SoftBank|WILLCOM|emobile|iPhone|iPod|Android.*Mobile)') {
    set $do_not_cache 1;
    }
    }
    }
    server {
    listen 8080;
    server_name _;

    #access_log /var/log/nginx/access_8080.log main;
    access_log /var/log/nginx/access_8080.log ;

    #location / {
    # root /usr/share/nginx/html;
    # index index.php index.html index.htm;
    #}

    #location ~ .php$ {
    # root html;
    # fastcgi_pass 127.0.0.1:9000;
    # fastcgi_index index.php;
    # fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
    # include fastcgi_params;
    # fastcgi_pass_header "X-Accel-Redirect";
    # fastcgi_pass_header "X-Accel-Expires";
    #}

    root /var/www/com.yapani/wp;
    index index.html index.htm index.php;

    # Make site accessible from http://localhost/
    server_name yapani.com;
    include hhvm.conf;

    if (!-e $request_filename) {
    rewrite ^.+?($/-.*) $1 last;
    rewrite ^.+?(/.*\.php)$ $1 last;
    rewrite ^ /index.php last;
    }

    location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
    # Uncomment to enable naxsi on this location
    # include /etc/nginx/naxsi.rules
    }
    }