# PHP with SSL

**URL:** <https://www.ruby-forum.com/t/php-with-ssl/208385>\
**Category:** NGINX\
**Created:** [June 16, 2011, 8:12pm UTC](https://www.ruby-forum.com/t/php-with-ssl/208385 "2011-06-16T20:12:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 16, 2011, 8:12pm UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/1 "2011-06-16T20:12:00Z")

</div>

Hello,

I followed the instruction from this link -  
[http://nginx.org/en/docs/http/configuring\_https\_servers.html](http://nginx.org/en/docs/http/configuring_https_servers.html)

- but I can’t solve some issue with PHP and SSL, basically web browser  
says that site is partially encrypted however when I commented out the  
location for the PHP/FastCGI everything works fine. I can access any  
directory/file (for instance [http://mydomain.com/randomfile](http://mydomain.com/randomfile)) over SSL  
but main website is not working.
- Do I need to enable some extra configuration?

Please find my config below:

http {  
…

## Global SSL options

ssl\_prefer\_server\_ciphers on;  
ssl\_session\_cache shared:SSL:10m;  
ssl\_session\_timeout 10m;  
…

## 

server {  
add\_header Cache-Control “public, must-revalidate”;  
expires 90d;  
index index.php index.html index.php;  
listen 192.168.1.10:443;  
root /home/web/mydomain.com;  
server\_name [mydomain.com](http://mydomain.com);

## SSL Certs (specific to this URL)

```
  ssl on;
  ssl_certificate /home/mydomain.com/mydomain.com.chained.crt;
  ssl_certificate_key /home/mydomain.com/mydomain.com.key;

```

## 

location ~ .php$ {  
root /home/web/mydomain.com;  
fastcgi\_pass 127.0.0.1:9000;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME  
/home/web/mydomain.com$fastcgi\_script\_name;  
include fastcgi\_params;  
}  
}

Posted at Nginx Forum:

> **[PHP with SSL](https://forum.nginx.org/read.php?2,207667,207667#msg-207667)**
>
> Hello, I followed the instruction from this link - http://nginx.org/en/docs/http/configuring\_https\_servers.html - but I can't solve some issue with PHP and SSL, basically web browser says that site is partially encrypted however when I commented out...

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 16, 2011, 9:39pm UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/2 "2011-06-16T21:39:42Z")

</div>

Make sure that your PHP output links to the https version of images and  
not the http version.

Posted at Nginx Forum:

> **[Re: PHP with SSL](https://forum.nginx.org/read.php?2,207667,207695#msg-207695)**
>
> Hello, I followed the instruction from this link - http://nginx.org/en/docs/http/configuring\_https\_servers.html - but I can't solve some issue with PHP and SSL, basically web browser says that site is partially encrypted however when I commented out...

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 16, 2011, 10:12pm UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/3 "2011-06-16T22:12:25Z")

</div>

## Ensiferous Wrote:

> Make sure that your PHP output links to the https  
> version of images and not the http version.

Hello,

Could you please elaborate on this. Do I need create another ‘location’?  
I’ve noticed that when I assess admin side of my website  
([http://mydomain.com/admin](http://mydomain.com/admin)) the site is encrypted but the main one  
([http://mydomain.com](http://mydomain.com)) is not.

Regards

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,207667,207708#msg-207708](http://forum.nginx.org/read.php?2,207667,207708#msg-207708)

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 17, 2011, 6:15am UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/4 "2011-06-17T06:15:15Z")

</div>

On Fri, Jun 17, 2011 at 3:11 AM, HTF [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ([http://mydomain.com](http://mydomain.com)) is not.

I’m still amazed how you put “http://” and “encrypted” in one sentence.

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 17, 2011, 7:37am UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/5 "2011-06-17T07:37:57Z")

</div>

edogawaconan Wrote:

> I’m still amazed how you put “http://” and  
> “encrypted” in one sentence.

This is just a typo mistake it should be https pf course.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,207667,207791#msg-207791](http://forum.nginx.org/read.php?2,207667,207791#msg-207791)

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 17, 2011, 9:09am UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/6 "2011-06-17T09:09:21Z")

</div>

Hello,

- now suddenly the browser indicates that site is encrypted however when  
I try to submit a form I have the following message:

"Although this page is encrypted, the information you have entered is to  
be sent over an unencrypted connection and could easily be read by a  
third party.

Are you sure you want to continue sending this information?"

Is it mean that some part of the website is still not encrypted. Could  
you please advise where I need to look for this specific configuration?

Regards

Posted at Nginx Forum:

> **[Re: PHP with SSL](https://forum.nginx.org/read.php?2,207667,207799#msg-207799)**
>
> Hello, I followed the instruction from this link - http://nginx.org/en/docs/http/configuring\_https\_servers.html - but I can't solve some issue with PHP and SSL, basically web browser says that site is partially encrypted however when I commented out...

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 17, 2011, 9:14am UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/7 "2011-06-17T09:14:17Z")

</div>

On Fri, Jun 17, 2011 at 2:08 PM, HTF [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is it mean that some part of the website is still not encrypted. Could  
> you please advise where I need to look for this specific configuration?

the php file which probably generated hardcoded link to http in the  
form.

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 17, 2011, 9:43am UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/8 "2011-06-17T09:43:57Z")

</div>

On Fri, Jun 17, 2011 at 2:17 PM, HTF [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> authentication and DHE\_RSA as the key exchange mechanism."
> 
> How to include all content to be secure?

check your php files

---

<div class="post-metadata">

**Author:** ![HTF](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@HTF](https://www.ruby-forum.com/u/HTF)\
**Post date:** [June 17, 2011, 9:18am UTC](https://www.ruby-forum.com/t/php-with-ssl/208385/9 "2011-06-17T09:18:37Z")

</div>

The previous message is from Firefox, the Google Chrome says:

"Your connection to [mydomain.com](http://mydomain.com) is encrypted with 256-bit encryption.  
However, this page includes other resources which are not secure. These  
resources can be viewed by others while in transit and can be modified  
by an attacker to change the behaviour of the page.

The connection uses TLS 1.0.

The connection is encrypted using AES\_256\_CBC, with SHA1 for message  
authentication and DHE\_RSA as the key exchange mechanism."

How to include all content to be secure?

Posted at Nginx Forum:

> **[Re: PHP with SSL](https://forum.nginx.org/read.php?2,207667,207803#msg-207803)**
>
> Hello, I followed the instruction from this link - http://nginx.org/en/docs/http/configuring\_https\_servers.html - but I can't solve some issue with PHP and SSL, basically web browser says that site is partially encrypted however when I commented out...
