Skip to content

Commit

Permalink
Nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
FozzeY committed Nov 18, 2023
1 parent 5b8641d commit 63ca4e6
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ansible/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
mode: 0600
with_fileglob:
- fozzey_ru.*
- name: Copy nginx config
copy:
src: nginx.conf
dest: /etc/nginx/
owner: root
group: wheel
mode: 0644
notify:
- restart nginx
handlers:
- name: restart sshd
service: name=sshd state=restarted
- name: restart nginx
service: name=nginx state=restarted
58 changes: 58 additions & 0 deletions ansible/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Take note of http://wiki.nginx.org/Pitfalls

#user www;
worker_processes 1;

#load_module "modules/ngx_stream_module.so";

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#error_log syslog:server=unix:/dev/log,severity=notice;

#pid logs/nginx.pid;

worker_rlimit_nofile 1024;
events {
worker_connections 800;
}


http {
include mime.types;
default_type application/octet-stream;
index index.html index.htm;

#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 logs/access.log main;
#access_log syslog:server=unix:/dev/log,severity=notice main;

#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server_tokens off;

server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}

HTTPS server

server {
listen 443 ssl;

server_name fozzey.ru;
ssl_certificate /etc/ssl/fozzey_ru.crt;
ssl_certificate_key /etc/ssl/fozzey_ru.key;
root /var/www/htdocs;
}
}

0 comments on commit 63ca4e6

Please sign in to comment.