Skip to content

Instantly share code, notes, and snippets.

@memezilla
Forked from simkimsia/ng-book.conf
Created July 9, 2016 02:52
Show Gist options
  • Select an option

  • Save memezilla/99239a7a39ae079bb3ad3eb21f41e5e4 to your computer and use it in GitHub Desktop.

Select an option

Save memezilla/99239a7a39ae079bb3ad3eb21f41e5e4 to your computer and use it in GitHub Desktop.
restler api nginx config
server {
listen 80;
client_max_body_size 2M;
server_name ng-book.oppoin.com;
root /var/virtual/ng-book.oppoin.com/current/examples/http-api-server;
location / {
index index.html index.htm;
}
location /api {
index index.php;
if ( !-e $request_filename) {
rewrite ^.* /api/index.php last;
}
}
# Pass PHP scripts to PHP-FPM
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
@memezilla

memezilla commented Jul 9, 2016

Copy link
Copy Markdown
Author
server {
    listen 80;
    client_max_body_size 2M;
    server_name ng-book.localhost;
    root /var/virtual/WebApps/ng-book/examples/http-api-server;

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

    location /api {
            index index.php;
            if ( !-e $request_filename) {
                    rewrite ^.* /api/index.php last;
            }
    }
    # Pass PHP scripts to PHP-FPM
    location ~* \.php$ {
        fastcgi_index   index.php;
        fastcgi_pass    127.0.0.1:9000;
        include         fastcgi_params;
        fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment