Herramientas de usuario

Herramientas del sitio


Barra lateral

notas:nginx

Nginx

Nginx, es un servidor web open source, tiene muchos módulos como por ejemplo para implementar un proxy reverso, cache de HTTP, y balanceador de carga.

Proxy Reverso

nginx.conf

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
 
events {
	worker_connections 768;
}
 
http {
	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
 
	server_names_hash_bucket_size 64;
	server_name_in_redirect off;
 
	include /etc/nginx/mime.types;
	default_type application/octet-stream;
 
	server_tokens off;
 
	open_file_cache                 max=10000 inactive=5m;
	open_file_cache_valid           1m;
	open_file_cache_min_uses        1;
	open_file_cache_errors          on;
 
	more_clear_headers Server;
 
	proxy_hide_header X-Powered-By;
 
	add_header X-Frame-Options SAMEORIGIN;
	add_header X-Content-Type-Options nosniff;
	add_header X-XSS-Protection "1; mode=block";
	add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";
 
	ignore_invalid_headers   on;
 
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;
 
	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;
 
	gzip on;
	gzip_disable "msie6";
 
	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}

site.cayu.com.ar

server {
  listen 80;
  listen [::]:80;
 
  server_name	owncloud.cayu.com.ar;
 
  access_log /var/log/nginx/owncloud-access.log;
  error_log /var/log/nginx/owncloud-error.log;
 
 
  location / {
		proxy_pass http://10.1.1.222;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-Proto $scheme;
  }
}
 
server {
    listen 443;
    listen [::]:443;
 
    server_name	owncloud.cayu.com.ar;
 
    ssl_certificate           /etc/nginx/ssl/cayu.crt;
    ssl_certificate_key       /etc/nginx/ssl/cayu.key;
 
    access_log /var/log/nginx/owncloud-ssl-access.log;
    error_log /var/log/nginx/owncloud-ssl-error.log;
 
    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
 
  location / {
		proxy_pass https://10.1.1.222;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-Proto $scheme;
  }
}
notas/nginx.txt · Última modificación: 2019/05/15 17:59 por cayu