October 22, 2015 08:17AM
Whilst trying out the auth_request module I figured I could run a local php file that connects to a database and checks if the user is valid.
I cannot figure out how to run the php script though, any ideas? This is my nginx.conf:

events {
worker_connections 10;
}

http {

upstream elasticsearch {
server 127.0.0.1:9200;
}

server {
root D:/ontw/tools/ELK-new/nginx-1.9.5/auth;
listen 8080;
location / {
auth_request /auth;
proxy_pass http://elasticsearch;
proxy_http_version 1.1;

}

location = /auth {
proxy_pass $document_root/authentication.php;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}


location ~ \.php$ {
if (!-f $document_root$fastcgi_script_name){
return 404;
}
root D:/ontw/tools/ELK-new/nginx-1.9.5/auth;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}

The authentication.php-script that should be run is located on D:/ontw/tools/ELK-new/nginx-1.9.5/auth. I don't know how to run it thoguh or how I can see the output of the script. I have the pgp-cgi.exe running on 127.0.0.1:9000, waiting for connections.

I'm probably missing something, but I don't see it or understand it.
Subject Author Posted

HTTP Authentication through database

JaminVP October 22, 2015 04:05AM

Re: HTTP Authentication through database

lhmwzy October 22, 2015 04:24AM

Re: HTTP Authentication through database

itpp2012 October 22, 2015 04:45AM

Re: HTTP Authentication through database

JaminVP October 22, 2015 08:17AM

Re: HTTP Authentication through database

itpp2012 October 22, 2015 09:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 245
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready