Entradas

Mostrando las entradas etiquetadas como Nginx

Deshabilitar los métodos HTTP peligrosos como PUT, DELETE y TRACE en Nginx

Imagen
  🔧 Paso 1: Editar el archivo de configuración de Nginx Objetivo: Configurar el servidor Nginx para que rechace solicitudes HTTP que usen los métodos PUT, DELETE y TRACE, devolviendo un código de estado 405 (Method Not Allowed) . ¿Por qué hacerlo? Por razones de seguridad . Algunos métodos HTTP como PUT , DELETE y TRACE pueden representar riesgos si no son utilizados correctamente. Si tu aplicación no los necesita, es recomendable deshabilitarlos. Instrucciones: Abre el archivo de configuración de Nginx. Generalmente se encuentra en: /etc/nginx/nginx.conf O también puede estar dentro del directorio: /etc/nginx/sites-available/ dependiendo de cómo esté estructurada tu instalación. Busca la sección que tenga location / { ... } o agrégala dentro del bloque server { ... } . Dentro de ese bloque, agrega las siguientes condiciones: location / { if ($request_method = PUT) { return 405; } if ($request_method = DELETE) { return 405; } ...

How to Set up & Use NGINX as a Reverse Proxy

Imagen
 Thank to: https://phoenixnap.com/ What is a Reverse Proxy? A standard  proxy server  works on behalf of clients, often by providing privacy or filtering content. A reverse proxy works on behalf of a server, intercepting traffic and routing it to a separate server. There are several reasons you might want to install a reverse proxy. One of the main reasons is privacy. If you have multiple servers, a reverse proxy can help balance loads between servers and improve performance. As a reverse proxy provides a single point of contact for clients, it can centralize logging and report across multiple servers. Nginx can improve performance by serving static content quickly and passing dynamic content requests to Apache servers. This guide will help you install and configure an Nginx reverse proxy on your system. Prerequisites A Linux server with Apache, PHP, and a firewall Access to a root user with  sudo  access Linux command-line or terminal ( Ctrl – Alt – T ...

How to Install Nginx Web Server on Ubuntu

 Thank to: https://phoenixnap.com/ Prerequisites A system running Ubuntu 18.04 A  user account with sudo  privileges The  apt package manager  utility, included by default The UFW, or UnComplicated Firewall, included by default SSH Access Steps to Installing Nginx on Ubuntu Update Software Repositories Log into your Server via SSH as the root user ssh root@hostname Before installing new software, it is strongly recommended to update your local software database. Updating helps to make sure you’re installing the latest and best-patched software available. Enter the following: sudo apt update Allow the process to finish. Install Nginx on Ubuntu Enter the following  to install Nginx on Ubuntu : sudo apt install nginx This may take some time for the system to download the software packages and install them. Allow it to complete before moving on. Verify Nginx Service is Running Use the following command to check the status of the Nginx service: sudo systemc...