Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I use NGINX 1.5.12 on Ubuntu 13.10 and HTTPS works fine and the pages are served (both HHVM and PHP5-FPM) trying to load the website in HTTP fails and WGET returns this:

HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: ‘index.html’

    [                                <=>    ] 44          --.-K/s   in 29s     

2014-04-05 11:55:37 (1.49 B/s) - ‘index.html’ saved [44]

and cURL returns this:

?d???? ???

while running cURL on HTTPS i get this:

HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: HHVM/3.1.0-dev+2014.04.04

My config


user www-data www-data;
pid /var/run/;
worker_rlimit_nofile 100000;

events {
    worker_connections  4096;
    multi_accept on;

http {
    default_type application/octet-stream;

    access_log off;
    error_log  /var/log/nginx/error.log crit;

    sendfile on;
    tcp_nopush on;

    keepalive_timeout 20;
    client_header_timeout 20;
    client_body_timeout 20;
    reset_timedout_connection on;
    send_timeout 20;

    types_hash_max_size 2048;

    gzip on;
    gzip_disable "msie6";
    gzip_proxied any;
    gzip_min_length 256;
    gzip_comp_level 4;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;

    server_names_hash_bucket_size 128;

    include mime.conf;
    charset UTF-8;

    open_file_cache max=100000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;

    server_tokens off;

    include proxy.conf;
    include fcgi.conf;

    include conf.d/*.conf;
    include /etc/nginx.custom.d/*.conf;


server {
    listen *:80;
    listen *:443 ssl;
    ssl_certificate /srv/;
    ssl_certificate_key /srv/;

    access_log /var/log/nginx/example-com.access.log;
    error_log /var/log/nginx/example-com.error.log;

    root /srv/;
    index index.html index.htm index.php;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

    location  / {

        try_files $uri $uri/ /index.php?$query_string;


    location ~ \.php$ {

        gzip off;

fastcgi_keep_conn on;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
include        fcgi.conf;


    location ^~ \.(jpg|jpeg|gif|css|png|js|ico|html)$ {

        access_log off;



I dont get why HTTPS works and HTTP wont?!

tried to change application/octet-stream to text/html but no difference at all.

share|improve this question
Is it possible that there is a http proxy server between the client and the server which messes with gzip compression or ssl certificates? – skarap Apr 5 '14 at 11:45
Try setting sendfile to off and see if that fixes it. I've had similar problems with sendfile. – Brandon Wamboldt Apr 5 '14 at 11:56
Did you manage to fix it? I have exactly the same issue with nginx 1.9.15 and have no clue how to fix it. – fycth Apr 20 at 10:35

Your Answer


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

Browse other questions tagged or ask your own question.