My services are hosted in AWS VPC. I use VPN to access my servers. For using a third party service I need to whitelist my public static IP address on their site. How can I get my public static IP address?
Shahrear Bin Amin's questions
I have a subdomain https://test.shop.com
, I'm running a Nginx server and it's working fine. But I have to accept the request with https://test.shop.com:8080/graphql/
and redirect to http://127.0.0.1:8000
to the same machine. I've added this block
location /graphql/ {
proxy_pass http://127.0.0.1:8000;
}
But when I try to access https://test.shop.com:8080/graphql/
from the browser it shows me This site can’t be reached seems something to do with dns. Although I can access https://test.shop.com/graphql/
and it works fine.
My whole config file is
server {
server_name test.shop.com;
root /var/www/html/test;
index index.html;
location / {
try_files $uri $uri/ /index.html?$args;
}
# dashboard app
location /dashboard/ {
try_files $uri $uri/ /dashboard/index.html?$args;
}
location /graphql/ {
proxy_pass http://127.0.0.1:8000;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/test.shop.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/test.shop.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = test.shop.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name test.shop.com;
return 404; # managed by Certbot
}
I was trying to install Jenkins
in my server Ubuntu 20.04
with the following commands
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins
But installation fails with dpkg: error processing package jenkins (--configure):
Job for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xe" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: failed (Result: exit-code) since Sun 2021-01-24 20:09:16 UTC; 13ms ago
Docs: man:systemd-sysv-generator(8)
Process: 1620107 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: Starting LSB: Start Jenkins at boot time...
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 jenkins[1620107]: ERROR: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 jenkins[1620107]: If you actually have java installed on the system make sure the executable is in the aforementioned path and that 'type -p java' returns the java executable path
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: jenkins.service: Control process exited, code=exited, status=1/FAILURE
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: Failed to start LSB: Start Jenkins at boot time.
dpkg: error processing package jenkins (--configure):
installed jenkins package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've tried this, removing and again installation, changing the content of /etc/securetty
here but none of them is working. I'm only facing this problem when I try to install Jenkins
in server, while I tried to install my own laptop having Ubuntu 20.04
it works fine.
I was trying to deploy my backend in heroku with docker. Here is my heroku.yml
file
setup:
addons:
- plan: heroku-postgresql
as: DATABASE
build:
docker:
web: mymeds/Dockerfile
release:
image: web
command:
- ./release-tasks.sh
run:
web: python manage.py run
But getting /bin/sh: 1: ./release-tasks.sh: not found although it's in the same folder. Here is my directory structure
Dec 15 05:58:17 mymedsbackend app/api Starting process with command `/bin/sh -c 'if curl $HEROKU_RELEASE_LOG_STREAM --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then
Dec 15 05:58:17 mymedsbackend app/api chmod u+x /tmp/log-stream
Dec 15 05:58:17 mymedsbackend app/api /tmp/log-stream /bin/sh -c '"'"'/bin/sh -c ./release-tasks.sh'"'"'
Dec 15 05:58:17 mymedsbackend app/api else
Dec 15 05:58:17 mymedsbackend app/api /bin/sh -c ./release-tasks.sh
Dec 15 05:58:17 mymedsbackend app/api fi'` by user [email protected]
Dec 15 05:58:22 mymedsbackend heroku/release.7559 Starting process with command `/bin/sh -c 'if curl https://heroku-release-output.s3.amazonaws.com/log-stream?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3LIQ2SWG7V76SVQ%2F20201215%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201215T135816Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=4f30c56d2f692e9d76dcaaebb9920cb7097c71cedcca597e26d2228de0e8497c --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then
chmod u+x /tmp/log-stream
/tmp/log-stream /bin/sh -c '"'"'/bin/sh -c ./release-tasks.sh'"'"'
else
/bin/sh -c ./release-tasks.sh
fi'`
Dec 15 05:58:23 mymedsbackend heroku/release.7559 State changed from starting to up
Dec 15 05:58:25 mymedsbackend heroku/release.7559 Process exited with status 127
Dec 15 05:58:25 mymedsbackend heroku/release.7559 State changed from up to complete
Dec 15 05:58:25 mymedsbackend app/release.7559 /bin/sh: 1: curl: not found
Dec 15 05:58:25 mymedsbackend app/release.7559 /bin/sh: 1: ./release-tasks.sh: not found
Dec 15 05:58:27 mymedsbackend app/api Release v35 command failed by user [email protected]
Dec 15 05:59:35 mymedsbackend heroku/router at=error code=H14 desc="No web processes running" method=GET path="/robots.txt" host=mymedsbackend.herokuapp.com request_id=0640e377-880e-4e05-9fcc-c5b541020aac fwd="103.149.142.2" dyno= connect= service= status=503 bytes= protocol=https
Dec 15 05:59:35 mymedsbackend heroku/router at=error code=H14 desc="No web processes running" method=GET path="/" host=mymedsbackend.herokuapp.com request_id=0bb24c8a-9064-4d37-8c14-0ac046947583 fwd="103.149.142.2" dyno= connect= service= status=503 bytes= protocol=https
Dec 15 05:59:36 mymedsbackend heroku/router at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=mymedsbackend.herokuapp.com request_id=ed25b7de-de79-479f-a060-e322534d39a4 fwd="103.149.142.2" dyno= connect= service= status=503 bytes= protocol=https
My release-tasks.sh
file is here
cd mymeds/
python manage.py db init
python manage.py db migrate --message 'initial database migration'
python manage.py db upgrade
I'm new in server deployment. For my e-commerce app I've two react projects, one is storefront
for customers and other is dashboard
for admins. I've setup my nginx server with the following configuration. I can access my storefront going https://shop.saleortest.com, but I want to access my dashboard using https://shop.saleortest.com/dashboard. This might be done with reverse proxy
, adding proxy_pass
inside the location
block. But I don't know how to achieve this.
I've tried adding this block, here https://admin.shop.saleortest.com running the same server. But it's not working
location /dashboard/ {
proxy_pass https://admin.shop.saleortest.com;
}
As example I can go to this site https://demo.saleor.io/ it's the storefront and if I go to https://demo.saleor.io/dashboard it takes me to dashboard
app, those are two different react app using the same domain. Here both storefront and dashboard are running in single server? How can I achieve something like this. Thanks.
server {
server_name shop.saleortest.com;
root /var/www/html/storefront;
index index.html;
location / {
try_files $uri $uri/ /index.html?$args;
}
location /graphql/ {
proxy_pass http://127.0.0.1:8000/graphql/;
}
location /dashboard/ {
proxy_pass https://admin.gethookedseafood.com;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/shop.saleortest.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/shop.saleortest.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = shop.saleortest.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name shop.saleortest.com;
return 404; # managed by Certbot
}
My website groceryshoptest.com
was hosted in Digital Ocean
droplets with a Nginx
server. I've used free SSL from Lets encrypts certbot, I've just put few commands which added some configuration in etc/nginx/sites-available/groceryshoptest
file and installed certificate everything was working fine.
Later I decided to move my server to Linode
. So I've stopped my previous server, pointed my DNS to my new server address, installed everything and it was working fine over http
. Then I again installed certificate from Letsencrypt
in my new Linode
server. It showed me everything installed successfully. So my problem is I can access the site from Bangladesh
but can't access from USA
following error in browser
ERR_TUNNEL_CONNECTION_FAILED
My config file is here
server {
server_name groceryshoptest.com;
root /var/www/html/shop;
index index.html;
location / {
try_files $uri $uri/ /index.html?$args;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/groceryshoptest.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/groceryshoptest.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = groceryshoptest.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name groceryshoptest.com;
return 404; # managed by Certbot
}