Having trouble converting this Apache directive
April 05, 2012 09:00PM

Alias /w3pw "/var/www/default/foo"
<Directory "/var/www/default/foo/">
SSLOptions +StrictRequire +OptRenegotiate
SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
and %{SSL_CLIENT_S_DN_Email} eq "my_email@my_domain" \
Options -Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all

Basically all I want to do is forbid access to /foo/index.php if client cert doesn't have what I am looking for. I have tried:

location ~ ^/w3pw/ {
if ($ssl_client_s_dn !~ "/CN=CAcert WoT User/emailAddress=my_email@my_domain") {
return 403;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;

The problem is that on success the php request is not passed on to the upstream php-fpm server. Instead, index.php gets served as a download.
Re: Having trouble converting this Apache directive
April 06, 2012 09:10AM
Ended up just passing $ssl_client_raw_cert to fastcgi and writing some PHP to deal with authentication.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
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