This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# update the location blocks try_files in your /sites-available/default | |
location / { | |
try_files $uri $uri/ /index.html$is_args$args; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add below to /etc/nginx/mime.types | |
application/x-font-ttf ttc ttf; | |
application/x-font-otf otf; | |
application/font-woff woff; | |
application/font-woff2 woff2; | |
application/vnd.ms-fontobject eot; | |
# add below to /sites/available/your-site | |
location ~* \.(eot|otf|ttf|woff|woff2)$ { | |
add_header Access-Control-Allow-Origin *; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# allow WP to FTP/access core/plugin folders | |
sudo chown -R www-data /var/www/html | |
# always set back when done | |
sudo chown -R sammy /var/www/html | |
# restart PHP on Ubuntu | |
sudo service php7.0-fpm restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fix Gunicorn socket with Nginx not working | |
# create a new gunicorn sock (for nginx) | |
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04#create-a-gunicorn-systemd-service-file | |
# NGINX - make sure same sock so nginx can talk to Gunicorn! | |
upstream app_server { | |
server unix:/home/django/django_project/MyAPIName/mysockname.sock fail_timeout=0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIX BOOTSTRAP CAROUSEL WHITE-SPACE BETWEEN SLIDES | |
.carousel-item { | |
transition: -webkit-transform 0.5s ease !important; | |
transition: transform 0.5s ease !important; | |
transition: transform 0.5s ease, -webkit-transform 0.5s ease !important; | |
-webkit-backface-visibility: visible !important; | |
backface-visibility: visible !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# full nginx conf for Django w/web-sockets | |
upstream app_server { | |
server 127.0.0.1:9000 fail_timeout=0; | |
} | |
upstream websocket { | |
server 127.0.0.1:8002 fail_timeout=0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place file in static root | |
from django.views.generic.base import RedirectView | |
from django.contrib.staticfiles.storage import staticfiles_storage | |
urlpatterns = [ | |
url(r'C798C4F2FDD57D2D63BF76874C080F49.txt', RedirectView.as_view( | |
url=staticfiles_storage.url('C798C4F2FDD57D2D63BF76874C080F49.txt'), | |
permanent=True), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app_server { | |
server 127.0.0.1:9000 fail_timeout=0; | |
} | |
upstream websocket { | |
server 127.0.0.1:8001 fail_timeout=0; | |
} | |
#server { | |
# listen 80; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gunicorn.conf | |
description "Gunicorn app server for Django Project" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
setuid username | |
setgid www-data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" dir="ltr" class="no-js"> | |
<head> | |
<title>WebSockets</title> | |
<script language="javascript" type="text/javascript"> | |
var wsUri = "wss://url.com.au/websockets/"; | |
var output; | |