Initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Restart nginx
|
||||
service:
|
||||
name=nginx
|
||||
state=restarted
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Install nginx
|
||||
yum:
|
||||
name: nginx
|
||||
|
||||
- name: enable nginx
|
||||
systemd:
|
||||
name: nginx
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: create /etc/nginx/nginx.conf from template
|
||||
template:
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/nginx.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: Restart nginx
|
||||
|
||||
- name: Allow apache to read files in /etc/letsencrypt/{{ letsEncryptDomain }}
|
||||
sefcontext:
|
||||
target: '/etc/letsencrypt/{{ letsEncryptDomain }}(/.*)?'
|
||||
setype: httpd_sys_content_t
|
||||
state: present
|
||||
notify:
|
||||
- Restore selinux context
|
||||
@@ -0,0 +1,74 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
|
||||
include /usr/share/nginx/modules/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# GZip Settings
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 10240;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript;
|
||||
gzip_disable "MSIE [1-6]\.";
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
return 301 https://{{ letsEncryptDomain }}$request_uri;
|
||||
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
server_name mini-beieli.ch;
|
||||
root {{ document_root }}/static;
|
||||
|
||||
error_page 502 /502.html;
|
||||
|
||||
location /lorahandler {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
}
|
||||
|
||||
location /static {
|
||||
autoindex off;
|
||||
root {{ document_root }}/;
|
||||
expires 30d;
|
||||
}
|
||||
|
||||
location / { try_files $uri @mini-beieli; }
|
||||
location @mini-beieli {
|
||||
proxy_pass http://127.0.0.1:4000;
|
||||
}
|
||||
|
||||
listen [::]:443 ssl ipv6only=on;
|
||||
listen 443 ssl;
|
||||
ssl_certificate /etc/letsencrypt/{{ letsEncryptDomain }}/fullchain.cer;
|
||||
ssl_certificate_key /etc/letsencrypt/{{ letsEncryptDomain }}/{{ letsEncryptDomain }}.key;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
server {
|
||||
server_name www.{{ my_domain }};
|
||||
root /opt/nginx/www.linuxtechwhiz.info;
|
||||
|
||||
location / {
|
||||
index index.html index.htm index.php;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/www.linuxtechwhiz.info.access.log;
|
||||
error_log /var/log/nginx/www.linuxtechwhiz.info.error.log;
|
||||
|
||||
location ~ \.php$ {
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
root {{ document_root }};
|
||||
server_name {{ ansible_hostname }}.{{ my_domain }};
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user