Skip to content

Instantly share code, notes, and snippets.

@codex5
Forked from rkjha/wordpress_nginx_config.conf
Created September 28, 2019 04:45
Show Gist options
  • Select an option

  • Save codex5/dae8d394f3efd1a98f30eb32da3208dc to your computer and use it in GitHub Desktop.

Select an option

Save codex5/dae8d394f3efd1a98f30eb32da3208dc to your computer and use it in GitHub Desktop.

Revisions

  1. @rkjha rkjha renamed this gist Mar 13, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @rkjha rkjha created this gist Mar 13, 2014.
    26 changes: 26 additions & 0 deletions wordpress_nginx_config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    server {
    listen 80;

    root /home/username/example.com;
    index index.php index.html;

    server_name example.com;

    location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
    # use fastcgi_pass 127.0.0.1:9000;
    # Or using unix socket :
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    }
    }

    server {
    listen 80;
    server_name www.example.com;
    return 301 $scheme://example.com$request_uri;
    }