Skip to content

Instantly share code, notes, and snippets.

@4ley
4ley / .htaccess
Created April 27, 2017 14:51
Force HTTPS
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@4ley
4ley / apache.conf
Created March 28, 2017 12:10
WordPress / Apache / Reverse Proxy
<VirtualHost ...>
...
# Reverse Proxy
ProxyRequests Off
#ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
ProxyPass /blog http://blog.example.org/blog
ProxyPassReverse /blog http://blog.example.org/blog
...
</VirtualHost>
@4ley
4ley / install
Last active July 22, 2016 13:48
Let's Encrypt Install Steps
# apt-get update && apt-get -y install git
# cd /usr/local/src/ && git clone https://github.com/letsencrypt/letsencrypt && cd letsencrypt/
# mkdir -p /usr/local/etc/letsencrypt/ && cp examples/cli.ini /usr/local/etc/letsencrypt/cli.ini
# nano /usr/local/etc/letsencrypt/cli.ini
# ./letsencrypt-auto certonly --config /usr/local/etc/letsencrypt/cli.ini
@4ley
4ley / app.js
Last active October 22, 2015 21:36
ng-admin templateUrl for custom header
// declare a function to run when the module bootstraps (during the 'config' phase)
app.config(['NgAdminConfigurationProvider', function(nga) {
// create an admin application
var admin = nga.application('Name')
.baseApiUrl('http://jsonplaceholder.typicode.com/'); // main API endpoint
admin.header('<div header></div>');
}]);