now gitea works
This commit is contained in:
parent
189e2ec60f
commit
d481a60a80
5 changed files with 3 additions and 104 deletions
|
@ -116,7 +116,7 @@ sites:
|
||||||
# Subnet addresses
|
# Subnet addresses
|
||||||
subnet_cidr_address: 172.27.6.0/24
|
subnet_cidr_address: 172.27.6.0/24
|
||||||
subnet_gateway_ip: 172.27.6.1
|
subnet_gateway_ip: 172.27.6.1
|
||||||
subnet_nginx_ip: 172.27.6.2
|
# subnet_nginx_ip: 172.27.6.2
|
||||||
subnet_site_ip: 172.27.6.3
|
subnet_site_ip: 172.27.6.3
|
||||||
# User ID (git on remote)
|
# User ID (git on remote)
|
||||||
user_uid: 1007
|
user_uid: 1007
|
||||||
|
|
|
@ -2,7 +2,6 @@ version: '3'
|
||||||
|
|
||||||
# Generated by ansible for site {{ site.url }}
|
# Generated by ansible for site {{ site.url }}
|
||||||
# On network {{ site.subnet_cidr_address }}:
|
# On network {{ site.subnet_cidr_address }}:
|
||||||
# - web server (nginx) at {{ site.subnet_nginx_ip }}
|
|
||||||
# - site (gitea) at {{ site.subnet_site_ip }}
|
# - site (gitea) at {{ site.subnet_site_ip }}
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -12,8 +11,7 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
APP_NAME: "Gitea: git with a cup of coffee"
|
APP_NAME: "Gitea: git with a cup of coffee"
|
||||||
# DOMAIN: "{{ site.url }}"
|
DOMAIN: "{{ site.url }}"
|
||||||
# ROOT_URL: "{{ site.url }}"
|
|
||||||
USER_UID: "{{ site.user_uid }}"
|
USER_UID: "{{ site.user_uid }}"
|
||||||
USER_GID: "{{ site.user_gid }}"
|
USER_GID: "{{ site.user_gid }}"
|
||||||
DB_TYPE: mysql
|
DB_TYPE: mysql
|
||||||
|
@ -29,24 +27,9 @@ services:
|
||||||
net:
|
net:
|
||||||
ipv4_address: "{{ site.subnet_site_ip }}"
|
ipv4_address: "{{ site.subnet_site_ip }}"
|
||||||
|
|
||||||
nginx:
|
|
||||||
build: nginx
|
|
||||||
restart: always
|
|
||||||
depends_on:
|
|
||||||
- site
|
|
||||||
volumes:
|
|
||||||
- "{{ site_data_path }}:/data"
|
|
||||||
networks:
|
|
||||||
net:
|
|
||||||
ipv4_address: "{{ site.subnet_nginx_ip }}"
|
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
net:
|
net:
|
||||||
ipam:
|
ipam:
|
||||||
driver: default
|
driver: default
|
||||||
config:
|
config:
|
||||||
- subnet: "{{ site.subnet_cidr_address }}"
|
- subnet: "{{ site.subnet_cidr_address }}"
|
||||||
|
|
||||||
volumes:
|
|
||||||
html_data:
|
|
||||||
|
|
|
@ -49,6 +49,6 @@ server {
|
||||||
location / {
|
location / {
|
||||||
include snippets/header-params_location.conf;
|
include snippets/header-params_location.conf;
|
||||||
|
|
||||||
proxy_pass http://{{ site.subnet_nginx_ip }}:80;
|
proxy_pass http://{{ site.subnet_site_ip }}:3000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
FROM nginx:latest
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
# Should be UID & GID=33
|
|
||||||
# USER www-data:www-data
|
|
|
@ -1,79 +0,0 @@
|
||||||
user www-data www-data;
|
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
|
||||||
pid /var/run/nginx.pid;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
http {
|
|
||||||
charset utf-8;
|
|
||||||
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
set_real_ip_from {{ site.subnet_gateway_ip }};
|
|
||||||
log_format main '$http_x_real_ip - $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;
|
|
||||||
|
|
||||||
##
|
|
||||||
# Basic Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
keepalive_timeout 15s;
|
|
||||||
types_hash_max_size 2048;
|
|
||||||
server_tokens off;
|
|
||||||
client_max_body_size 10M;
|
|
||||||
client_body_timeout 60;
|
|
||||||
# server_names_hash_bucket_size 64;
|
|
||||||
server_name_in_redirect off;
|
|
||||||
|
|
||||||
|
|
||||||
##
|
|
||||||
# Gzip Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
gzip_disable "msie6";
|
|
||||||
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_proxied any;
|
|
||||||
gzip_comp_level 6;
|
|
||||||
gzip_buffers 16 8k;
|
|
||||||
gzip_http_version 1.1;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
|
|
||||||
include /etc/nginx/conf.d/*.conf;
|
|
||||||
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name {{ site.url }} www.{{ site.url }};
|
|
||||||
|
|
||||||
root /data;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header X-Url-Scheme $scheme;
|
|
||||||
proxy_redirect off;
|
|
||||||
proxy_max_temp_file_size 0;
|
|
||||||
proxy_read_timeout 120;
|
|
||||||
|
|
||||||
proxy_pass http://{{ site.subnet_site_ip }}:3000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue