• Как правильно настроить редирект с http на https в Symfony 3?

    @chipirov Автор вопроса
    У меня вроде бы так и есть. Могу ошибаться, я несилен в nginx
    #user 'www-root' virtual host 'site.ru' configuration file
    server {
    	server_name site.ru www.site.ru;
    	charset off;
    	disable_symlinks if_not_owner from=$root_path;
    	index index.html index.php;
    	root $root_path;
    	set $root_path /var/www/www-root/data/www/site.ru/web;
    	ssi on;
    	access_log /var/www/httpd-logs/site.ru.access.log ;
    	error_log /var/www/httpd-logs/site.ru.error.log notice;
    	include /etc/nginx/vhosts-includes/*.conf;
    	include /etc/nginx/vhosts-resources/site.ru/*.conf;
    
    	location / {
    		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
    			try_files $uri $uri/ @fallback;
    		}
    		location / {
    			try_files /does_not_exists @fallback;
    		}
    		location ~ [^/]\.ph(p\d*|tml)$ {
    			try_files /does_not_exists @fallback;
    		}
    		
    	}
    	location @fallback {
    		error_log /dev/null crit;
    		proxy_pass http://127.0.0.1:8080;
    		proxy_set_header Host $host;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		proxy_set_header X-Forwarded-Proto $scheme;
    		proxy_set_header X-Forwarded-Port $server_port;
    		access_log off ;
    		proxy_redirect http://127.0.0.1:8080 /;
    	}
    	listen [ipaddress]::80;
    }
    server {
    	server_name site.ru www.site.ru;
    	charset off;
    	disable_symlinks if_not_owner from=$root_path;
    	index index.html index.php;
    	root $root_path;
    	set $root_path /var/www/www-root/data/www/site.ru/web;
    	ssi on;
    	access_log /var/www/httpd-logs/site.ru.access.log ;
    	error_log /var/www/httpd-logs/site.ru.error.log notice;
    	include /etc/nginx/vhosts-includes/*.conf;
    	include /etc/nginx/vhosts-resources/site.ru/*.conf;
    	location / {
    		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
    			try_files $uri $uri/ @fallback;
    		}
    		location / {
    			try_files /does_not_exists @fallback;
    		}
    		location ~ [^/]\.ph(p\d*|tml)$ {
    			try_files /does_not_exists @fallback;
    		}
    		
    	}
    	location @fallback {
    		error_log /dev/null crit;
    		proxy_pass http://127.0.0.1:8080;
    		proxy_set_header Host $host;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		proxy_set_header X-Forwarded-Proto $scheme;
    		proxy_set_header X-Forwarded-Port $server_port;
    		access_log off ;
    		proxy_redirect http://127.0.0.1:8080 /;
    	}
    	listen [ipaddress]:443;
    	ssl on;
    	ssl_certificate "/var/www/httpd-cert/www-root/site.ru.crtca";
    	ssl_certificate_key "/var/www/httpd-cert/www-root/site.ru.key";
    }