Skip to content
Snippets Groups Projects
Commit 15287341 authored by Arthur Le Bars's avatar Arthur Le Bars
Browse files

added galaxy_nginx_conf writing

parent 139db9f1
No related branches found
No related tags found
2 merge requests!3release 1.0.1,!2Corrections cloud
......@@ -76,13 +76,37 @@ class DeploySpeciesStack(speciesData.SpeciesData):
logging.debug("Using default banner for Tripal pages")
self.config.pop("banner_path", None)
# Write galaxy_nginx.conf
try:
with open(os.path.abspath(os.path.join(self.script_dir, "galaxy_nginx.conf")), "w") as galaxy_nginx_conf:
galaxy_nginx_conf.truncate(0)
galaxy_nginx_conf.write("uwsgi_param QUERY_STRING $query_string;")
galaxy_nginx_conf.write("uwsgi_param REQUEST_METHOD $request_method;")
galaxy_nginx_conf.write("uwsgi_param CONTENT_TYPE $content_type;")
galaxy_nginx_conf.write("uwsgi_param CONTENT_LENGTH $content_length;")
galaxy_nginx_conf.write("uwsgi_param REQUEST_URI $request_uri;")
galaxy_nginx_conf.write("uwsgi_param PATH_INFO $document_uri;")
galaxy_nginx_conf.write("uwsgi_param DOCUMENT_ROOT $document_root;")
galaxy_nginx_conf.write("uwsgi_param SERVER_PROTOCOL $server_protocol;")
galaxy_nginx_conf.write("uwsgi_param REQUEST_SCHEME $scheme;")
galaxy_nginx_conf.write("uwsgi_param HTTPS $https if_not_empty;")
galaxy_nginx_conf.write("uwsgi_param REMOTE_ADDR $remote_addr;")
galaxy_nginx_conf.write("uwsgi_param REMOTE_PORT $remote_port;")
galaxy_nginx_conf.write("uwsgi_param SERVER_PORT $server_port;")
galaxy_nginx_conf.write("uwsgi_param SERVER_NAME $server_name;")
galaxy_nginx_conf.write("uwsgi_param HTTP_REMOTE_USER gga;")
except OSError as exc:
logging.critical("Cannot write galaxy NginX conf file (%s)" % os.path.abspath(self.script_dir))
sys.exit(exc)
# Create nginx dirs and write/re-write nginx conf
make_dirs(dir_paths_li=["./nginx", "./nginx/conf"])
try:
with open(os.path.abspath("./nginx/conf/default.conf"), 'w') as conf:
conf.write("server {\n\tlisten 80;\n\tserver_name ~.;\n\tlocation /download/ {\n\t\talias /project_data/; \n\t\tautoindex on;\n\t}\n}") # The species nginx conf
except OSError as exc:
logging.critical("Cannot edit NginX conf file")
logging.critical("Cannot write NginX conf file")
sys.exit(exc)
# Return to main directory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment