This file contains 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 myapp { | |
server 0.0.0.0:8000; | |
} | |
server { | |
listen 80; # EL PUERTO EN EL QUE ESTOY ESCUCHANDO EN EL SERVIDOR | |
listen [::]:80 default_server ipv6only=on; | |
server_name muebleria.rodolfougalde.xyz; | |
server_tokens off; #NO DESPLEGAR LA VERSION DE NGINX EN ERROR LOGS | |
access_log /var/log/nginx/myapp.log; # LOG DE LOS ERRORES |
This file contains 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
COMO ROOT EN /etc/nginx/sites-available/myapp | |
upstream myapp { | |
server 0.0.0.0:8000; | |
} | |
limit_req_zone $binary_remote_addr zone=admin:10m rate=1r/s; # 10MB DE ESPACIO PARA IP's QUE INTENTAN ENTRAR A /admin 1 SOLICITUD/s | |
include /etc/nginx/blockuseragents.rules; # SE INCLUYE EL ARCH PARA BLOQUEAR HTTP Agents | |
limit_conn_zone $binary_remote_addr zone=addr:5m; # LIMIT THE NUMBER OF CONNECTIONS BY IP IN NGINX |
This file contains 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
----> /bin/gunicorn_start.sh | |
#!/bin/bash | |
NAME="landingpage" # NOMBRE DE LA APLICACION | |
DJANGODIR=/home/<carpeta>/<carpeta>/landingpage # DIRECTORIO DEL PROYECTO DE DJANGO | |
# SOCKFILE=/webapps/hello_django/run/gunicorn.sock # TIPO DE SOCKET POR EL CUAL NOS COMUNICAREMOS UNIX | |
USER=<usuario> # EL USUARIO QUE VA A CORRER LA APP | |
GROUP=<grupo> # EL GRUPO AL QUE PERTENECE EL USUARIO QUE CORRE LA APP | |
NUM_WORKERS=1 # EL NUEMERO DE PROCESOS QUE CORRERA GUNICORN | |
DJANGO_SETTINGS_MODULE=<nombredeproyecto>.settings # QUE ARCHIVO DE SETTINGS OCUPARA DJANGO | |
DJANGO_WSGI_MODULE=<nombredeproyecto>.wsgi # NOMBRE DEL MODULO WSGI |
NewerOlder