server { listen 80 default_server; listen [::]:80 default_server; server_name *.ccldlidar.com; return 301 https://$host$request_uri; } server { listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl on; ssl_certificate /etc/nginx/security/ccldlidar.com.crt; ssl_certificate_key /etc/nginx/security/ccldlidar.com.key; root /var/www/ccldlidar.com/htdocs; # Add index.php to the list if you are using PHP index index.php index.html; server_name *.ccldlidar.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location /api/ { try_files $uri $uri/ /api/index.php$is_args$args; } location /dashboard/ { try_files $uri $uri/ /dashboard/index.php$is_args$args; } location /weiss/ { alias /var/www/weiss-prod/; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_param ENVIRONMENT production; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # With php5-cgi alone: #fastcgi_pass 127.0.0.1:9000; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }