http


Configuring Nginx for WordPress

A typical Vhost file (for example /etc/nginx/sites-available/default) would look like this: server {   listen   80;   server_name  YOUR_SERVER_NAME;   access_log  /var/log/nginx/access.log;   root /var/www;   index index.php;   location / {    index index.php;    try_files $uri $uri/ /index.php?q=$uri&$args;   }   location ~ \.php$ {               […]


Using Debian behind a Proxy

If you are using Debian behind a proxy (e.g. Squid), you just have to declare the following environment variables to use it: export HTTP_PROXY=[IP]:[PORT] export HTTPS_PROXY=[IP]:[PORT] export FTP_PROXY=[IP]:[PORT] Change [IP] and [PORT] accordingly. In order to stay persistent, you could add the above commands to ~/.profile or /etc/bash.bashrc for example.


Redirecting to https using .htaccess

Based on HTTPS variable: RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] Redirect everything that's not being served on port 443 to https: RewriteCond %{SERVER_PORT} !^443$ RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] Redirect everything served on port 80 to https: RewriteCond %{SERVER_PORT} ^80$ RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]