Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to set up https (let nginx listen on 443, with the ssl settings) and access my page, the quite surprising thing happens that I see my php code being displayed.

I see this in the nginx config fastcgi_pass;

Does it means nginx direct the php request to port 9000? my setting for https is like this

server {
listen 443;

ssl on;
ssl_certificate /etc/domain_com.crt;
ssl_certificate_key /etc/domain.key;
ssl_protocols SSLv3 TLSv1;


BTW my original structure is haproxy to nginx. Hope someone experienced on this can enlighten me a little bit. Thanks!

share|improve this question
up vote 1 down vote accepted

You're missing the location ~ \.php block which passes requests upstream to php-fpm. Copy and paste it from your server block which serves the HTTP web site. Except for the SSL-specific settings, the two server blocks should probably be identical.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.