[Lxr-commits] CVS: lxr/templates/Nginx nginx-fastcgi.conf.part, NONE, 1.1 nginx-lxrserver.conf, NON
Brought to you by:
ajlittoz
From: Andre-Littoz <ajl...@us...> - 2013-09-24 10:00:57
|
Update of /cvsroot/lxr/lxr/templates/Nginx In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9845/templates/Nginx Added Files: nginx-fastcgi.conf.part nginx-lxrserver.conf Log Message: templates/Nginx: new configuration templates for nginx web server --- NEW FILE: nginx-fastcgi.conf.part --- #- #- LXR nginx server configuration #- FastCGI block #- #- $Id: nginx-fastcgi.conf.part,v 1.1 2013/09/24 10:00:54 ajlittoz Exp $ #- #- #- This file fragment is meant to be "included" to form the #- complete configuration file. #- #- This fragment sets up nginx parameters for launching LXR scripts #- in FastCGI mode through a wrapper. #- { set $virtroot $1; set $script_name $2; gzip off; #gzip makes scripts feel slower since they have to complete before getting gzipped alias %LXRroot%/; # Create FastCGI environment for LXR scripts include fastcgi.conf; fastcgi_split_path_info (diff|ident|search|showconfig|source)(.*)$; # nginx bug? fastcgi.conf sets SERVER_NAME to $server_name, # but this variable is equal to first name on server_name # directive. # However, this fix is not bullet-proof: $host is equal to value # of HTTP header Host: if it exists, otherwise it reverts # to $server_name. # Consequently, there are residual cases where the correct # hostname is not captured and CSS stylesheets and icons # are not retrieved. fastcgi_param SERVER_NAME $host; fastcgi_param SCRIPT_FILENAME $document_root$script_name; fastcgi_param SCRIPT_NAME $virtroot$script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass unix:/var/run/fcgiwrap.socket; } --- NEW FILE: nginx-lxrserver.conf --- # # LXR nginx server configuration # #- $Id: nginx-lxrserver.conf,v 1.1 2013/09/24 10:00:54 ajlittoz Exp $ #- #- ####################################### # server - defines general parameters # ####################################### # # IMPORTANT! # If LXR is offered as part of an existing server defined in another # configuration file, DO NOT use this one. # Instead, extract the location paragraphs and transfer them into # that other configuration file. # # Servers are considered identical (and thus conflict) if they # have the same name and operate on the same port. server { #@IF 'H' ne "%_routing%" listen %port%; # server port #@ ARRAY portaliases,P #@ ON none # Add other listen directives if your LXR server answers on multiple ports #@ ENDON #@ ON prolog # Other ports for this server # NOTE: remove duplicates since they cause trouble #@ ENDON listen %P%; #@ ENDA #@ENDIF #@PASS2 here_ports #@ IF 'H' eq "%_routing%" # listen XX; # where XX = port number for host %hostname% #@ ENDIF #@ENDP2 #@IF 'H' ne "%_routing%" && 'P' ne "%_routing%" #@ ARRAY hostaliases,H #@ ON none server_name %hostname%; # list of names for this server # In case of aliases, replace the previous directive with # server_name first.host.name first.alias second.alias ... ; #@ ENDON #@ ON prolog server_name %hostname% #@ ENDON %H% #@ ON epilog ; #@ ENDON #@ ENDA #@ENDIF #@PASS2 here_hosts #@ IF 'H' eq "%_routing%" server_name %hostname% # List here the aliases for this host name ; #@ ELSEIF 'P' eq "%_routing%" server_name %treeid%.%hostname% #@ ARRAY hostaliases,H #@ ON none # List here the aliases for this host name #@ ENDON %treeid%.%H% #@ ENDA ; #@ ENDIF #@ENDP2 # If SSI (server-side includes) are needed, # uncomment the following line. # But, BEWARE, #include semantics is different from Apache or lighttpd # ssi on; # locations tell how to route URLs # #==================================# # The following images are not needed by LXR, but included just in case # you want to display them in header or footer. location ~ nginx-logo.png$ { alias /usr/share/nginx/html/nginx-logo.png; } location ~ poweredby.png$ { alias /usr/share/nginx/html/poweredby.png; } # The error page definitions are copied from nginx's default.conf. # They do use the previous images. # Normally, not needed by LXR. error_page 404 404.html; location = /404.html { root /usr/share/nginx/html; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # ============================================================ # # # LXR scripts activation # # #========================# # # This location directive manages both the virtual root and tree # (in multiple trees context) identifications. It is configured # for the built-in policy where tree designation is put after the # virtual root in the URL as (remember that location's omit the # "scheme", hostname and port): # # /virtual_root/tree/script/arguments for "embedded" case # /virtual_root/script/arguments other cases # # Pattern matching is used to isolate the different components: # ^ virtrootbase / [^/]+ / (.*) $ # start ----root---- treename URLtail end # # If you don't use the built-in policy, you must adapt the following # regular expression to your needs. #@IF 'S' ne "%_routing%" && 'E' ne "%_routing%" location ~ ^%virtrootbase%/(.*)$ #@ELSEIF 'E' eq "%_routing%" #@ IF 'c' eq "%_virtrootpolicy%" #@ REMIND Remember to adapt the tree designation for nginx #@ ENDIF location ~ ^%virtrootbase%/[^/]+/(.*)$ #@ENDIF #@IF 'S' ne "%_routing%" { # # Next, we must handle differently "ordinary" files (like stylesheets # or images) and scripts files. # This alias directive serves the ordinary files. # Note we don't use root directive because we must replace the head # part of the path. alias %LXRroot%/$1; # Script files will be handled by FastCGI. # Scripts are first identified by a more specific regular expression # whose head is similar to the previous one. See above for its structure # and the warning about the multiple trees policy. #@ IF 'E' ne "%_routing%" location ~ ^(%virtrootbase%/)(diff|ident|search|showconfig|source) #@ ELSE location ~ ^(%virtrootbase%/[^/]+/)(diff|ident|search|showconfig|source) #@ ENDIF #@ ADD Nginx/nginx-fastcgi.conf.part } #@ENDIF !'S' #@PASS2 here_sections #@ IF 'S' eq "%_routing%" location ~ ^(%virtroot%/)(.*)$ { # # Next, we must handle differently "ordinary" files (like stylesheets # or images) and scripts files. # This alias directive serves the ordinary files. # Note we don't use root directive because we must replace the head # part of the path. alias %LXRroot%/$1; # Script files will be handled by FastCGI. # Scripts are first identified by a more specific regular expression # whose head is similar to the previous one. See above for its structure. location ~ ^(%virtroot%/)(diff|ident|search|showconfig|source) #@ ADD Nginx/nginx-fastcgi.conf.part } #@ ENDIF #@ENDP2 # # ============================================================ # Close server definition } |