Line 166: |
Line 166: |
| # | | # |
| server { | | server { |
− | listen 80 default_server; | + | #listen 80 default_server; |
− | listen [::]:80 default_server; | + | #listen [::]:80 default_server; |
| | | |
| server_name openfoodfacts.eu *.openfoodfacts.eu; | | server_name openfoodfacts.eu *.openfoodfacts.eu; |
Line 182: |
Line 182: |
| | | |
| root /home/off/html; | | root /home/off/html; |
| + | |
| + | access_log /home/off/logs/nginx.access.log; |
| + | error_log /home/off/logs/nginx.error.log; |
| + | |
| + | gzip on; |
| + | gzip_min_length 1000; |
| + | |
| + | # Forward the client IP header |
| + | proxy_set_header X-Real-IP $remote_addr; |
| + | #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| + | proxy_set_header X-Forwarded-For $remote_addr; |
| + | |
| | | |
| # Add index.php to the list if you are using PHP | | # Add index.php to the list if you are using PHP |
| index index.html index.htm index.nginx-debian.html; | | index index.html index.htm index.nginx-debian.html; |
| + | |
| + | location ~* \.(eot|ttf|woff|woff2)$ { |
| + | add_header Access-Control-Allow-Origin *; |
| + | } |
| + | |
| + | location ~ ^/images/products/ { |
| + | add_header Link "<http://creativecommons.org/licenses/by-sa/3.0/>; rel='license'; title='CC-BY-SA 3.0'"; |
| + | } |
| + | |
| + | location ~ ^/(favicon.ico) { |
| + | # First attempt to serve request as file, then |
| + | # as directory, then fall back to displaying a 404. |
| + | try_files $uri $uri/ =404; |
| + | } |
| + | |
| | | |
| location ~ ^/(images|js|rss|data|files|resources|foundation)/ { | | location ~ ^/(images|js|rss|data|files|resources|foundation)/ { |
Line 215: |
Line 242: |
| #} | | #} |
| } | | } |
| + | |
| </pre> | | </pre> |
| | | |
Line 245: |
Line 273: |
| # LoadModule perl_module modules/mod_perl.so | | # LoadModule perl_module modules/mod_perl.so |
| | | |
− | PerlWarn Off | + | PerlWarn On |
| PerlRequire /home/off/cgi/startup_apache2.pl | | PerlRequire /home/off/cgi/startup_apache2.pl |
| | | |
| + | # log the X-Forwarded-For IP address (the client ip) in access_log |
| + | LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy |
| | | |
| <Location /cgi> | | <Location /cgi> |
Line 260: |
Line 290: |
| <VirtualHost *> | | <VirtualHost *> |
| DocumentRoot /home/off/html | | DocumentRoot /home/off/html |
− | ServerName openfoodfacts.eu | + | ServerName openfoodfacts.org |
| ErrorLog /home/off/logs/error_log | | ErrorLog /home/off/logs/error_log |
| CustomLog /home/off/logs/access_log combined | | CustomLog /home/off/logs/access_log combined |
− | LogLevel debug | + | LogLevel warn |
| ScriptAlias /cgi/ "/home/off/cgi/" | | ScriptAlias /cgi/ "/home/off/cgi/" |
| | | |