Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Shouldn’t need a rewrite rule. Have you tied something like this: <br> <br>server_name example.org www.example.org; <br>instead of <br>server_name _; ?
Of course, that entry was already there before trying to solve the url-IP/domain issue having the sites-available configuration file as follow: <br> <br>/etc/nginx/sites-available/mydomain.tld <br>-------------------------------------------------------- <br>#server { <br># server_name _; <br># rewrite ^ $scheme://www.mydomain.tld$request_uri last; <br>#} <br> <br>server { <br> #listen 80; ## listen for ipv4; this line is default and implied <br> #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 <br> <br> root /usr/share/nginx/www/mydomain.tld; <br> index index.html index.htm index.php; <br> <br> include global/common.conf; <br> include global/wordpress.conf; <br> <br> server_name mydomain.tld www.mydomain.tld; <br> <br> location /doc/ { <br> alias /usr/share/doc/; <br> autoindex on; <br> allow 127.0.0.1; <br> allow ::1; <br> deny all; <br> } <br>} <br>-------------------------------------------------------- <br>(he rewrite-trick is currently commented) <br> <br> <br>For completeness ill add the included configuration files, may this will help. <br> <br>/etc/nginx/global/wordpress.conf <br>------------------------------------------------ <br>location / { <br> try_files $uri $uri/ /index.php?$args; <br>} <br> <br>location ~* /(?:uploads|files)/..php$ { <br> deny all; <br>} <br> <br>location ~ .php$ { <br> try_files $uri =404; <br> fastcgi_split_path_info ^(.+.php)(/.+)$; <br> fastcgi_pass unix:/var/run/php5-fpm.sock; <br> fastcgi_index index.php; <br> include fastcgi_params; <br>} <br> <br>rewrite /wp-admin$ $scheme://$host$uri/ permanent; <br> <br>location ~ ^.+.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { <br> access_log off; log_not_found off; expires max; <br>} <br>------------------------------------------------ <br> <br> <br>/etc/nginx/global/common.conf <br>--------------------------------------------- <br>listen 80; <br> <br>location = /favicon.ico { <br> log_not_found off; <br> access_log off; <br>} <br> <br>location = /robots.txt { <br> allow all; <br> log_not_found off; <br> access_log off; <br>} <br> <br>error_page 404 /404.html; <br> <br>error_page 500 502 503 504 /50x.html; <br> location = /50x.html { <br> root /usr/share/nginx/www; <br> } <br> <br>location ~ /. { <br> deny all; <br>} <br> <br>location ~* ^.+.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { <br> access_log off; log_not_found off; expires 30d; <br>} <br>--------------------------------------------- <br> <br> <br>