start nginx
This commit is contained in:
parent
5d27509f50
commit
d683e6795b
|
@ -13,35 +13,11 @@ let
|
|||
proxy_read_timeout = "120";
|
||||
in
|
||||
writeText "erpnext.conf" ''
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /tmp/erpnext/logs/nginx/error.log notice;
|
||||
pid /tmp/erpnext/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include ${nginx}/conf/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
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 /tmp/erpnext/logs/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
upstream backend-server {
|
||||
server ${backend} fail_timeout=0;
|
||||
}
|
||||
|
@ -103,7 +79,8 @@ http {
|
|||
rewrite ^(.+)\.html$ $proxy_x_forwarded_proto://${frappe_site_name_header}$1 permanent;
|
||||
|
||||
location ~ ^/files/.*.(htm|html|svg|xml) {
|
||||
add_header Content-disposition "attachment";
|
||||
# TODO: Figure out how to do this.
|
||||
# add_header Content-disposition "attachment";
|
||||
try_files /${frappe_site_name_header}/public/$uri @webserver;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
} {
|
||||
guest.port = 9090;
|
||||
host.port = 9090;
|
||||
} {
|
||||
guest.port = 8081;
|
||||
host.port = 8081;
|
||||
}];
|
||||
};
|
||||
|
||||
|
@ -119,6 +122,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
config = builtins.readFile "${pkgs.erpnext-nginx-conf}";
|
||||
};
|
||||
|
||||
systemd.services.erpnext =
|
||||
let
|
||||
penv = pkgs.python3-erpnext.buildEnv.override {
|
||||
|
@ -162,9 +170,6 @@
|
|||
export PYTHON_PATH=${penv}/${pkgs.python3-erpnext.sitePackages}
|
||||
export PATH="${pkgs.mariadb-client}/bin:${pkgs.nodejs}/bin:${penv}/bin:$PATH"
|
||||
|
||||
cat /etc/hosts
|
||||
${pkgs.nettools}/bin/netstat -nptel
|
||||
|
||||
# Upstream initializes the DB with this command
|
||||
# TODO: Make this idempotent
|
||||
cd /var/lib/erpnext/bench/sites
|
||||
|
|
Loading…
Reference in a new issue