Asset URLs not HTTPS I'm currently redirecting all requests to https. I've updated the siteUrl variable and all of my entry links have been correctly updated but the image links are still http.

When I go to the admin panel all of the CSS/JS files wont load because the site is trying to load them over HTTP instead of HTTPS.



server {

  listen   443;

  root /var/www/&lt;url&gt;/htdocs;
  index index.php index.html index.htm;

  ssl on;
  ssl_certificate /etc/ssl/cert.crt;
  ssl_certificate_key /etc/ssl/rsa.key;
  server_name &lt;url&gt;;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header X-Forwarded-Proto https;
  client_max_body_size 10M;


  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/opt/remi/php55/root/var/run/php-fpm/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }

  location / {
  try_files $uri $uri/ @rewrites;
  }

  location @rewrites {
    rewrite ^(.*) /index.php?p=$1 last;
  }

  # Errors

  error_page 404 /index.php;
  error_page 500 502 503 504 /50x.html;

  location = /50x.html {
    root /var/www/&lt;url&gt;/htdocs;
  }

  # Enable gzip compression
  gzip on;
  gzip_comp_level 2;
  gzip_http_version 1.0;
  gzip_proxied any;
  gzip_min_length 1100;
  gzip_buffers 16 8k;
  gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

  # Disable for IE &lt; 6 because there are some known problems
  gzip_disable "MSIE [1-6].(?!.*SV1)";

  # Add a vary header for downstream proxies to avoid sending cached gzipped files to IE6
  gzip_vary on;

}
Yii will check for the following server environment variables when determining if it’s an SSL request:


HTTPS – should be set to “on”, “ON”, or “1”; or
HTTP_X_FORWARDED_PROTO – should be set to “https” or “HTTPS”


Apparently this is a common issue when running PHP on Nginx, since that HTTPS env variable is only an Apache convention.

Here’s an article that demonstrates how to fix it. According to that, you just need to add the following to your server config.

fastcgi_param HTTPS on;


You can probably add it right before/after your other fastcgi_param line.