Done:
server {
listen 80;
listen 443 ssl;
server_name obiektywnarozkosz.pl;
# root /var/www/obiektywnarozkosz.pl;
rewrite ^/(.*)$ https://www.obiektywnarozkosz.pl/$1 permanent;
# return 301 http://www.obiektywnarozkosz.pl;
}
server {
listen 80;
listen 443 ssl;
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
root /var/www/obiektywnarozkosz.pl;
index index.php;
server_name www.obiektywnarozkosz.pl;
if ($request_uri ~ "/index.(php|html?)") {
rewrite ^ /$1 permanent;
}
# location / {
# try_files $uri $uri/ /index.php;
# }
location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff)$ {
expires 365d;
}
location ~ (\.sql.gz|\.sql) { return 403; }
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
And got the error:
Failed authorization procedure. www.obiektwynarozkosz.pl (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: DNS problem: NXDOMAIN looking up A for www.obiektwynarozkosz.pl
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: www.obiektwynarozkosz.pl
Type: connection
Detail: DNS problem: NXDOMAIN looking up A for
www.obiektwynarozkosz.pl
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.