From: Jeremy Tan Date: Mon, 30 Sep 2013 07:25:34 +0000 (-0700) Subject: Merge pull request #51 from jtanx/master X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3a26204db04e6c4e6393fe4969b4f2668bb4be2e;hp=53e459aa529d076b7feea7e340a7f0e232e85cef;p=matches%2FMCTX3420.git Merge pull request #51 from jtanx/master Cookie stuff and log path fixed --- diff --git a/server-configs/nginx/fastcgi_params b/server-configs/nginx/fastcgi_params index 51aa692..b5b9858 100644 --- a/server-configs/nginx/fastcgi_params +++ b/server-configs/nginx/fastcgi_params @@ -2,6 +2,7 @@ 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 COOKIE_STRING $http_cookie; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_NAME $fastcgi_script_name; diff --git a/server-configs/nginx/sites-enabled/mctxconfig b/server-configs/nginx/sites-enabled/mctxconfig index 1be361a..97e46b6 100644 --- a/server-configs/nginx/sites-enabled/mctxconfig +++ b/server-configs/nginx/sites-enabled/mctxconfig @@ -81,13 +81,13 @@ server { } #Program log - location ^~ /api/log { + location = /api/log { alias /var/log/mctxserv.log; default_type text/plain; } #Program error log - location ^~ /api/errorlog { + location = /api/errorlog { alias /var/log/mctxserv-error.log; default_type text/plain; } diff --git a/testing/cookie-test/readme.txt b/testing/cookie-test/readme.txt new file mode 100644 index 0000000..fb52249 --- /dev/null +++ b/testing/cookie-test/readme.txt @@ -0,0 +1,7 @@ +compile with: +gcc test.c -lfcgi -o test + +Run with: +spawn-fcgi -p9005 -n ./test + +nginx must be configured to pass $http_cookie as an evironment variable named COOKIE \ No newline at end of file diff --git a/testing/cookie-test/test.c b/testing/cookie-test/test.c new file mode 100644 index 0000000..7f88239 --- /dev/null +++ b/testing/cookie-test/test.c @@ -0,0 +1,10 @@ +#include +#include +int main() { + while (FCGI_Accept() >= 0) { + printf("Content-type: text\r\n"); + printf("Set-Cookie: name=value with spaces; and a semicolon\r\n"); + printf("Set-Cookie: name2=value2\r\n\r\n"); + printf("Cookie:%s\n", getenv("COOKIE_STRING")); + } +}