Skip to content

Commit

Permalink
Adding fast cgi parameters to the nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Delval committed Dec 18, 2013
1 parent 37c9603 commit 538f7fd
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelogs
@@ -1,3 +1,8 @@
0.2.1 : 19 decembre 2013
- Adding fastcgi parameters to the nginx.conf
0.2.0 : 18 december 2013
- Migrating away from coco
- Using swig as template language
0.1.0 : 02 february 2012
- Adding the sng configuration file
0.0.10 : 10 january 2012
Expand Down
7 changes: 5 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "sng",
"version": "0.2.0",
"version": "0.2.1",
"description": "THE script that manages NGinx/PHP developement server",
"keywords": ["nginx", "php", "developement server", "fun"],
"homepage" : "https://github.com/fe-lix-/node-sng",
Expand All @@ -26,5 +26,8 @@
"email" : "felix.delval@gmail.com",
"url" : "http://blog.delval.eu"
},
"licence" : "MIT/X11"
"licence" : "MIT/X11",
"engines": {
"node": ">=0.8"
}
}
25 changes: 24 additions & 1 deletion templates/behaviors/standard.conf.tpl
Expand Up @@ -16,6 +16,29 @@ location / {
location ~ \.php$ {
fastcgi_pass {{ php_bind }};
fastcgi_index index.php;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param HTTPS $https if_not_empty;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
fastcgi_param SCRIPT_FILENAME {{ base }}$fastcgi_script_name;
fastcgi_param SERVER_SOFTWARE {{ meta.name }}/{{ meta.version }};
}
}
23 changes: 23 additions & 0 deletions templates/behaviors/zend.conf.tpl
Expand Up @@ -31,6 +31,29 @@ if (!-e $request_filename) {
location ~ \.php$ {
fastcgi_pass {{ php_bind }};
fastcgi_index index.php;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param HTTPS $https if_not_empty;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
fastcgi_param SCRIPT_FILENAME {{ base }}$fastcgi_script_name;
fastcgi_param SERVER_SOFTWARE {{ meta.name }}/{{ meta.version }};
}

0 comments on commit 538f7fd

Please sign in to comment.