Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # FORGE CONFIG (DOT NOT REMOVE!)
- include forge-conf/example.com/before/*;
- server {
- listen 80;
- server_name www.example.com;
- return 301 https://www.example.com;
- }
- server {
- listen 443 ssl;
- server_name example.com;
- #redirect non www to www.
- return 301 https://www.example.com;
- # root /home/forge/example.com/public;
- # FORGE SSL (DO NOT REMOVE!)
- ssl_certificate /etc/nginx/ssl/example.com/140111/server.crt;
- ssl_certificate_key /etc/nginx/ssl/example.com/140111/server.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- index index.html index.htm index.php;
- charset utf-8;
- # FORGE CONFIG (DOT NOT REMOVE!)
- include forge-conf/example.com/server/*;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location = /favicon.ico { access_log off; log_not_found off; }
- location = /robots.txt { access_log off; log_not_found off; }
- access_log off;
- error_log /var/log/nginx/example.com-error.log error;
- error_page 404 /index.php;
- location ~ .php$ {
- fastcgi_split_path_info ^(.+.php)(/.+)$;
- fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- }
- location ~ /.ht {
- deny all;
- }
- #cache:
- location ~* .(css|js|gif|jpe?g|png)$ {
- expires 168h;
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- }
- }
- server {
- listen 443 ssl;
- server_name www.example.com;
- root /home/forge/example.com/public;
- # FORGE SSL (DO NOT REMOVE!)
- ssl_certificate /etc/nginx/ssl/example.com/140111/server.crt;
- ssl_certificate_key /etc/nginx/ssl/example.com/140111/server.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- index index.html index.htm index.php;
- charset utf-8;
- # FORGE CONFIG (DOT NOT REMOVE!)
- include forge-conf/example.com/server/*;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location = /favicon.ico { access_log off; log_not_found off; }
- location = /robots.txt { access_log off; log_not_found off; }
- access_log off;
- error_log /var/log/nginx/example.com-error.log error;
- error_page 404 /index.php;
- location ~ .php$ {
- fastcgi_split_path_info ^(.+.php)(/.+)$;
- fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- }
- location ~ /.ht {
- deny all;
- }
- #cache:
- location ~* .(css|js|gif|jpe?g|png)$ {
- expires 168h;
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- }
- }
- # FORGE CONFIG (DOT NOT REMOVE!)
- include forge-conf/example.com/after/*;
- server {
- listen 80;
- listen 443 default_server ssl;
- server_name www.example.com;
- ssl_certificate /path/to/my/cert;
- ssl_certificate_key /path/to/my/key;
- if ($scheme = http) {
- return 301 https://$server_name$request_uri;
- }
- }
- server {
- listen 80;
- server_name www.example.com example.com;
- # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
- return 302 https://www.example.com$request_uri;
- }
- server {
- listen 443;
- server_name example.com;
- include /etc/nginx/conf-available/ssl.conf;
- # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
- return 302 https://www.example.com$request_uri;
- }
- server {
- listen 443 ssl http2 default_server;
- # listen [::]:443 ssl http2 default_server;
- server_name www.example.com;
- include /etc/nginx/conf-available/ssl.conf;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement