i am running nginx(nginx/1.10.0) as my webserver behind AWS ELB with drupal 7 and using php7.1 issue is http://url works fine but same site with https://url serves only https components of the page and not the non https components like css etc.

and ssl termination is happening on AWS ELB side

this is my nginx configuration

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  listen 443 ssl http2 default_server;
  listen [::]:443 ssl http2 default_server;

  server_name site_url;

  root /var/www/html/smb;
  index index.php index.html index.htm ;

  error_page 404 = @smb;

  location @smb {
     rewrite ^(.*)$ /index.php?q=$1 last;


  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.1-fpm.sock;

  location ~ /\.ht {
    deny all;

closed as off-topic by ceejayoz, Jenny D, MadHatter, mdpc, peterh Jun 12 '17 at 0:24

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – Jenny D, MadHatter, peterh
  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – ceejayoz, mdpc
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    "the site with https://url serves only https components of the page and not the non https components like css" - The solution is primarily to fix your code/html to prevent what is called Mixed Content (where your secure site loads insecure content) for instance by using relative URL's rather than absolute URL's to link to your stylesheets, because modern webbrowsers are like to complain about that if they don't outright block such insecure content... – HBruijn May 23 '17 at 13:03

If ssl termination is happening on AWS ELB side, why you still using port 443? It's not needed, you could use only port 80 to handle all requests, because you don't need any SSL.

And as @HBruijn said, you have problem with your application, not nginx. Looks like there is hardcoded URLs with http:// for css etc. You should check your code and fix it.

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