Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I have on my website an admin/ subdirectory, which I'd like to be in HTTPS, so I tried the following configuration, based on this onethis one :

I have on my website an admin/ subdirectory, which I'd like to be in HTTPS, so I tried the following configuration, based on this one :

I have on my website an admin/ subdirectory, which I'd like to be in HTTPS, so I tried the following configuration, based on this one :

Notice removed Draw attention by Baronsed
Bounty Ended with Rouben Tchakhmakhtchian's answer chosen by Baronsed
Tweeted twitter.com/#!/StackUnix/status/463107018883358720
Notice added Draw attention by Baronsed
Bounty Started worth 50 reputation by Baronsed
added 111 characters in body
Source Link
Baronsed
  • 90
  • 1
  • 8

Given the error.log file, I think the problem comes from the first location instruction in the HTTPS server (the difference with the HTTP one being ~ \.php$). So I tried to make the exact symetricSo I tried to make the exact symetric (with \.php$ instructions in another location instruction) :

Given the error.log file, I think the problem comes from the first location instruction in the HTTPS server (the difference with the HTTP one being ~ \.php$). So I tried to make the exact symetric (with \.php$ instructions in another location instruction) :

Given the error.log file, I think the problem comes from the first location instruction in the HTTPS server (the difference with the HTTP one being ~ \.php$). So I tried to make the exact symetric (with \.php$ instructions in another location instruction) :

added 111 characters in body
Source Link
Baronsed
  • 90
  • 1
  • 8
server {
    listen 443 ssl;
    [...]

    location /blog/admin/* {
        try_files $uri $uri/ $uri/index.php /index.html;
    }

    location / {
        return 301 http://$server_name$request_uri;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}
location /blog/admin/* {
    try_files $uri $uri/ $uri/index.php /index.html;
}

location / {
    return 301 http://$server_name$request_uri;
}

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
}
server {
    listen 443 ssl;
    [...]

    location /blog/admin/* {
        try_files $uri $uri/ $uri/index.php /index.html;
    }

    location / {
        return 301 http://$server_name$request_uri;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}
deleted 1 character in body
Source Link
Baronsed
  • 90
  • 1
  • 8
Loading
Source Link
Baronsed
  • 90
  • 1
  • 8
Loading