Nginx
Ā
InstalaciĆ³n NGINXĀ
Ā
#NGINX
Ā
add-apt-repository -y ppa:nginx/stable
apt-get update
apt-get install -y nginx
Ā
Creo certificados para SSL
mkdir /etc/nginx/ssl
cd /etc/nginx/ssl/
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Ā
ConfiguraciĆ³n
Ā
/etc/nginx/sites-enabled/default
server {
access_log off;
client_max_body_size 100M;
sendfile on;
send_timeout 600s;
proxy_buffering off;
gzip on;
gzip_types image/x-icon text/plain text/json
application/xml application/json image/png image/svg+xml
application/javascript text/css application/x-www-form-urlencoded;
server_name localhost;
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location /uContact {
alias /etc/IntegraServer/web/uContact/;
}
location /workflowsdesigner {
alias /etc/IntegraServer/web/workflowsdesigner;
}
location /formsdesigner {
alias /etc/IntegraServer/web/formsdesigner;
}
location /forms {
alias /etc/IntegraServer/web/forms;
}
location /images {
alias /etc/IntegraServer/web/images;
}
location /Integra {
auth_basic "uContact Restricted API";
auth_basic_user_file /etc/nginx/.htpasswd;
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Headers "*";
proxy_pass http://localhost:8085;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /records {
auth_basic "uContact Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
add_header 'Access-Control-Allow-Origin' "*";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
if ($request_method = 'OPTIONS') {
return 204;
}
alias /var/spool/asterisk/monitor/;
}
location /tmp {
add_header Access-Control-Allow-Origin "*";
alias /etc/IntegraServer/web/tmp/;
}
location /sounds {
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Headers "*";
alias /var/lib/asterisk/sounds/;
}
location /moh {
add_header Access-Control-Allow-Origin "*";
alias /var/lib/asterisk/;
}
location /layouts/ {
alias /etc/IntegraServer/reports/;
}
location /marcablanca {
alias /etc/IntegraServer/web/uContact/;
}
}
si no levanta sacar el listen de ambos puertos para ipv6
service nginx restart