Title: AWS, NGINX
Last modified: December 26, 2023

---

# AWS, NGINX

 *  [Steven Cooper](https://wordpress.org/support/users/kingcooper/)
 * (@kingcooper)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/aws-nginx/)
 * Hi my champion frieends.
 * I’m starting a site at TLD.net. It continuelly redirects, causign a loop i think.
 * Its on the AWS server, EC2. The Target Group HTTP forwards traffic to HTTPS.
 * In the NGINX code, i have this on page /etc/nginx/conf.d/wordpress.org:
 * map $blogname $blogid{ default -999;
 *     ```wp-block-code
       #Ref: https://wordpress.org/extend/plugins/nginx-helper/ include 
       #/var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ;
       ```
   
 * }
 * server { server_name integritytoysales.net ;
 *     ```wp-block-code
       root /var/www/html/wordpress/integritytoysales.net/htdocs; index index.php;
   
       location ~ ^(/[^/]+/)?files/(.+) { try_files /wp-content/blogs.dir/$blogid/files/$2
           /wp-includes/ms-files.php?file=$2 ; access_log off; log_not_found off; expires
           max;
       }
   
       #avoid php readfile()
       location ^~ /blogs.dir { internal; alias
           /var/www/html/wordpress/integritytoysales.net/htdocs/wp-content/blogs.dir ; access_log >
           off; expires max;
       }
   
       if (!-e $request_filename) { rewrite /wp-admin$ $scheme://$host$request_uri/
           permanent; rewrite ^(/[^/]+)?(/wp-.*) $2 last; rewrite ^(/[^/]+)?(/.*\.php) $2
           last;
       }
   
       location / { try_files $uri $uri/ /index.php?$args ;
       }
   
       location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass php;
       }
       ```
   
 * Alsok i have this in /etc/nginx/conf.d/###.net.conf:
 * server { listen 80; root /var/www/html/wordpress; server_name integritytoysales.
   net; return 301
   [https://$server_name$request_uri](https://$server_name$request_uri);}
   listen 443 ssl; managed by Certbot ssl_certificate
 *     ```wp-block-code
       /etc/letsencrypt/live/integritytoysales.net/fullchain.pem;
       ```
   
 * managed by Cer>
 *     ```wp-block-code
       ssl_certificate_key /etc/letsencrypt/live/integritytoysales.net/privkey.pem;
       ```
   
 * managed by C>
 * include /etc/letsencrypt/options-ssl-nginx.conf; managed by Certbot
 *     ```wp-block-code
       ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
       ```
   
 * managed by Certbot
 * }
   server { if ($host = integritytoysales.net) { return 301 [https://$host$request_uri](https://$host$request_uri);}
   managed by Certbot
 * listen 80; server_name integritytoysales.net; return 404; managed by Certbot
 * }
 * *****
   I have added these codes from sourcers on the internet. But htere is no
   tutorial based on launching a fresh wordpress and changing it to multisite for
   nginx codes in /etc/nginx/conf.d files.
 * Anyone know what i should be doing? Becuase i dont. 🙂
   Thanks
 * Steve
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Faws-nginx%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Steven Cooper](https://wordpress.org/support/users/kingcooper/)
 * (@kingcooper)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/aws-nginx/#post-17302592)
 * So, if i have it forward to HTTPS from HTTP in Listener and Target Group at AWS,
   does this mean i should not have any of those codes in /etc/nginx/conf.d/####.
   conf ????
 * Is the nginx code seperated from the AWS server listener and target group listener?
   
   I have some success with getting the site up, instead of endless redirects. When
   i achieved that i had code in /etc/nginx/conf.d/wordpress.conf file.Although 
   i edited the code from what was suggested to add. It was code from 2022, so i
   feel it was probably out of date. I cant seem to find that code atm.
 * But, its not clear on what i add to the /etc/nginx/conf.d/wordpress.conf file.
   
   And its not clear if i need both …/nginx/conf.d/wordpresss.conf and nginx/conf.
   d/###.net.conf files to work ok.
 * And, do i setup for single site to start. And change over the nginx/conf.d files
   as i progress into multisite?
   These tutorials i find online, they are awesome
   with the amount of work in to them. But for a dummy like me i find it difficult
   to read between the lines when they omitt some of the deets.
 * Any help? CHeers
 * Steve
 *  [George Appiah](https://wordpress.org/support/users/gappiah/)
 * (@gappiah)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/aws-nginx/#post-17303556)
 * Why is your domain returning three different IP addresses simultaneously? Is 
   this how your AWS infrastructure is set up?
 *  Thread Starter [Steven Cooper](https://wordpress.org/support/users/kingcooper/)
 * (@kingcooper)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/aws-nginx/#post-17304558)
 * Hi there, i have changed to apache now, got out of nginx. Im more familiar with
   apache…
   No, i didnt know the domain is showing three ip addresses. Is it because
   my SSL certificate has three domain names, but they are not mapped yet in Route
   53 DNS mapping?
 * Should i remove the other domain s in the SSL certificate to start?
 * I have installed apache now, ill open another more specific ticket about that.
 * Thanks George, appreciated.
 * Steve
 *  Thread Starter [Steven Cooper](https://wordpress.org/support/users/kingcooper/)
 * (@kingcooper)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/aws-nginx/#post-17308264)
 * Its all working fine now. Sohappy.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘AWS, NGINX’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Steven Cooper](https://wordpress.org/support/users/kingcooper/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/aws-nginx/#post-17308264)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
