... | ... | @@ -106,7 +106,18 @@ If someone clicks on an external link inside a survey, the website that link poi |
|
|
|
|
|
### Nginx
|
|
|
|
|
|
#### A working example
|
|
|
#### Generate authentication file for administration folder
|
|
|
|
|
|
Create the `.htpasswd` file with the following command (you may need to install the package `apache2-utils`) where you change the values for user and password to your convenience:
|
|
|
|
|
|
```bash
|
|
|
sudo -u www-data htpasswd -bc /path/to/framadate/admin/.htpasswd user password
|
|
|
```
|
|
|
|
|
|
Note that the path or name of the .htpasswd does not matter for nginx. put it outside of a web accessible could be a great idea.
|
|
|
|
|
|
|
|
|
#### A working example with HTTPS
|
|
|
|
|
|
```nginx
|
|
|
server {
|
... | ... | @@ -121,7 +132,8 @@ server { |
|
|
listen [::]:443 ssl http2; # For ipv6 only
|
|
|
server_name date.example.org;
|
|
|
|
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' https://dev.stats.latoilescoute.net 'unsafe-inline' 'unsafe-eval'; object-src 'none'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' https://dev.stats.latoilescoute.net";
|
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self'";
|
|
|
add_header Referrer-Policy "strict-origin";
|
|
|
|
|
|
# Those ssl certificats is generated by letsencrypt, to create an certificat
|
|
|
# through lets encrypt information are available here https://certbot.eff.org/lets-encrypt/debianstretch-nginx
|
... | ... | @@ -138,9 +150,9 @@ server { |
|
|
|
|
|
index index.php;
|
|
|
|
|
|
location ~^/(\.git)/{
|
|
|
location ~^/(\.git)/{
|
|
|
deny all;
|
|
|
}
|
|
|
}
|
|
|
location ~ /\. {
|
|
|
deny all;
|
|
|
}
|
... | ... | @@ -188,7 +200,6 @@ server { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Secure server
|
|
|
##### Content Security Policy
|
|
|
```nginx
|
... | ... | |