1 | ##
|
---|
2 | # You should look at the following URL's in order to grasp a solid understanding
|
---|
3 | # of Nginx configuration files in order to fully unleash the power of Nginx.
|
---|
4 | # https://www.nginx.com/resources/wiki/start/
|
---|
5 | # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
|
---|
6 | # https://wiki.debian.org/Nginx/DirectoryStructure
|
---|
7 | #
|
---|
8 | # In most cases, administrators will remove this file from sites-enabled/ and
|
---|
9 | # leave it as reference inside of sites-available where it will continue to be
|
---|
10 | # updated by the nginx packaging team.
|
---|
11 | #
|
---|
12 | # This file will automatically load configuration files provided by other
|
---|
13 | # applications, such as Drupal or Wordpress. These applications will be made
|
---|
14 | # available underneath a path with that package name, such as /drupal8.
|
---|
15 | #
|
---|
16 | # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
|
---|
17 | ##
|
---|
18 |
|
---|
19 | # Default server configuration
|
---|
20 | #
|
---|
21 | server {
|
---|
22 | listen 80 default_server;
|
---|
23 | #listen [::]:80 default_server;
|
---|
24 | server_name pootle.sahanafoundation.org;
|
---|
25 | return 301 https://$server_name$request_uri;
|
---|
26 | }
|
---|
27 |
|
---|
28 |
|
---|
29 | # Virtual Host configuration for example.com
|
---|
30 | #
|
---|
31 | # You can move that to a different file under sites-available/ and symlink that
|
---|
32 | # to sites-enabled/ to enable it.
|
---|
33 | #
|
---|
34 | #server {
|
---|
35 | # listen 80;
|
---|
36 | # listen [::]:80;
|
---|
37 | #
|
---|
38 | # server_name example.com;
|
---|
39 | #
|
---|
40 | # root /var/www/example.com;
|
---|
41 | # index index.html;
|
---|
42 | #
|
---|
43 | # location / {
|
---|
44 | # try_files $uri $uri/ =404;
|
---|
45 | # }
|
---|
46 | #}
|
---|
47 |
|
---|
48 | server {
|
---|
49 | listen 443 ssl default_server; # managed by Certbot
|
---|
50 | #listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
---|
51 | server_name pootle.sahanafoundation.org; # managed by Certbot
|
---|
52 |
|
---|
53 | ssl_certificate /etc/letsencrypt/live/pootle.sahanafoundation.org/fullchain.pem; # managed by Certbot
|
---|
54 | ssl_certificate_key /etc/letsencrypt/live/pootle.sahanafoundation.org/privkey.pem; # managed by Certbot
|
---|
55 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
---|
56 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
---|
57 |
|
---|
58 | location /favicon.ico {
|
---|
59 | alias /home/pootle/env/lib/python2.7/site-packages/pootle/assets/favicon.ico;
|
---|
60 | expires max;
|
---|
61 | }
|
---|
62 | location /assets/ {
|
---|
63 | alias /home/pootle/env/lib/python2.7/site-packages/pootle/assets/;
|
---|
64 | expires max;
|
---|
65 | }
|
---|
66 |
|
---|
67 | location / {
|
---|
68 | # First attempt to serve request as file, then
|
---|
69 | # as directory, then fall back to displaying a 404.
|
---|
70 | #try_files $uri $uri/ =404;
|
---|
71 | uwsgi_pass localhost:59025;
|
---|
72 | include /etc/nginx/uwsgi_params;
|
---|
73 | uwsgi_param UWSGI_SCHEME $scheme;
|
---|
74 | uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
---|
75 | uwsgi_param POOTLE_SETTINGS /home/pootle/env/pootle.conf;
|
---|
76 | port_in_redirect off;
|
---|
77 | proxy_redirect off;
|
---|
78 | }
|
---|
79 |
|
---|
80 | #root /var/www/html;
|
---|
81 |
|
---|
82 | # Add index.php to the list if you are using PHP
|
---|
83 | #index index.html index.htm index.nginx-debian.html;
|
---|
84 |
|
---|
85 | # pass PHP scripts to FastCGI server
|
---|
86 | #
|
---|
87 | #location ~ \.php$ {
|
---|
88 | # include snippets/fastcgi-php.conf;
|
---|
89 | #
|
---|
90 | # # With php-fpm (or other unix sockets):
|
---|
91 | # fastcgi_pass unix:/run/php/php7.3-fpm.sock;
|
---|
92 | # # With php-cgi (or other tcp sockets):
|
---|
93 | # fastcgi_pass 127.0.0.1:9000;
|
---|
94 | #}
|
---|
95 |
|
---|
96 | # deny access to .htaccess files, if Apache's document root
|
---|
97 | # concurs with nginx's one
|
---|
98 | #
|
---|
99 | #location ~ /\.ht {
|
---|
100 | # deny all;
|
---|
101 | #}
|
---|
102 |
|
---|
103 | }
|
---|