How can I make two domain names work with a heroku app?
I have a heroku app, that is configured with two domain names. Say abc.com and www.abc.com. My problem is visiting these two domain names show me different results for authentication. Say, if I'm logged in from abc.com and then I visit www.abc.com, I will have to re-login at www.abc.com, even though I logged in from abc.com.
How can I fix this at heroku?. I am a beginner at this. Any help will be appreciated. Please do guide.
do you know?
how many words do you know
See also questions close to this topic
-
How to check CRL https, url , revoked or not?
Write a bash script to check whether the given certificate (sample cert.cer) is on the Certificate Revocation List (CRL) from the Certificate Authority (CA) by following the steps below : • Step 1: Extracting and printing out the CRL HTTP(S) of CA’s Server.
• Step 2: Extracting and printing out CRL’s filename. • Step 3: Downloading the CRL from CA’s server (you can use the wget command). • Step 4: Extracting the list of serial numbers from the CRL. • Step 5: Extracting the serial number from the given certificate (sam- ple cert.cer).
• Step 6: Checking whether the given certificate’s serial number (extract- ed in Step 5) is from the CA’s CRL (extracted in Step 4) or not. If “yes”, please print out “The given certificate is on the CRL, i.e., revoked by the CA”, otherwise please print out “The given certificate is not on the CRL, i.e., not revoked by the CA”.
-
Having issues with multi virtual hosts with ssl
In the first run my first virtual host was successfully running well with SSL however when I tried to do it on second one it is not working anymore First I edit apache
httpd-xampp.conf
and added this, So basically based on this article: Using Multiple SSL Certificates in Apache with One IP Address<VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/proteksyon" ServerAdmin admin@proteksyon.ph ServerName proteksyon.ph ServerAlias *.proteksyon.ph SSLEngine On SSLCertificateFile "crt/proteksyon.ph/server.crt" SSLCertificateKeyFile "crt/proteksyon.ph/server.key" <Directory "C:/xampp/htdocs/proteksyon"> AllowOverride All Order Allow,Deny Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:443> DocumentRoot "C:/xampp/htdocs/proteksyon" ServerAdmin admin@proteksyon.ph ServerName proteksyon.ph ServerAlias *.proteksyon.ph SSLEngine On SSLCertificateFile "crt/proteksyon.ph/server.crt" SSLCertificateKeyFile "crt/proteksyon.ph/server.key" <Directory "C:/xampp/htdocs/proteksyon"> AllowOverride All Order Allow,Deny Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/clique" ServerAdmin support@clique.me ServerName clique.me ServerAlias clique.me SSLEngine On SSLCertificateFile "crt/clique.me/server.crt" SSLCertificateKeyFile "crt/clique.me/server.key" <Directory "C:/xampp/htdocs/clique"> AllowOverride All Order Allow,Deny Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:443> DocumentRoot "C:/xampp/htdocs/clique" ServerAdmin support@clique.me ServerName clique.me ServerAlias clique.me SSLEngine On SSLCertificateFile "crt/clique.me/server.crt" SSLCertificateKeyFile "crt/clique.me/server.key" <Directory "C:/xampp/htdocs/clique"> AllowOverride All Order Allow,Deny Allow from all Require all granted </Directory> </VirtualHost>
And this is the inputs for my
hosts
file:127.0.0.1 clique.me 127.0.0.1 proteksyon.ph
When accessing the
proteksyon.ph
everything is good and SSL is working fine it access the file of proteksyon and htdocs. When it comes to accessing/browsing the clique.me it throw this kind of error: -
How to prevent SNI from displaying incorrect web page over port 443?
I have a server with ISPConfig 3 installed.
When a new website is added to the server and is accessed via a browser with HTTPS, the website that is displayed is that of the first website (alphabetically).
This appears to be due to SNI.
How do I (with apache), ensure that a website is still served over HTTPS with an error even if no certificate is installed.
Normally a site simply displays a warning but allows one to proceed to the website.
-
Hosting frontend and backend on two different Heroku domains
I made a full-stack web application with React and Express as part of my portfolio projects. I tried publishing it on Vercel and Heroku (tried Netlify also) but unfortunately, I learned that sending cookies between two different domains is not possible. The next thing I tried, is to host both on Heroku (e.g:
client.herokuapp.com
&server.herokuapp.com
) which, unfortunately, does not work also.What else do I need to do? I am still learning how to deploy properly so I might miss out on some workarounds. Advice is greatly appreciated.
-
There is an error 502 .How can i solve it .(Internal Server Error)
I use to load server code in
heroku
. Sometime I get data fromheroku
.But sometime give me an error in 502. I usenoSql
databaseMongoDB
-
Heroku buttons styling issue
I made an app locally and pushed it on Heroku. The app is working perfectly on Heroku, however on the Homepage I have 2 buttons ( login and register ). When I run my app locally my buttons have some whitespace in between and they are rounded ( I am using tailwind for this). But on Heroku both buttons are not rounded and there is no whitespace in between them. When I inspect the button on Heroku, I see: class:".... rounded-full", which is what I expected and should have made the button rounded. Anyone has any idea what could cause this and how I can solve this ?
This is how my index.js looks like:
export default function Login() { return( <div> <Loginbuttons/> </div> ) }
and Loginbuttons.js defined as:
import Link from 'next/link' export default function Loginbutton(props){ return ( <div> <div className = 'block'> <button style={{width:"10%", paddingTop:"15px", paddingBottom:"15px"}} className='mt-10 mb-10 bg-blue-500 hover:bg-blue-700 text-wgvhite font-bold py-2 px-4 rounded-full'> <Link href='login' style={{textDecoration: 'none'}}>Login</Link> </button> <button style={{width:"10%", paddingTop:"15px", paddingBottom:"15px"}} className='mt-10 mb-10 ml-10 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full'> <Link href='register' style={{textDecoration: 'none'}}>Register</Link> </button> </div> </div>)}
-
How to host go api on GCP
I am new to this deployment and on my local computer my project api written in GOLANG which is already dockerized and uses mariadb as backend. It will execute on port 8080 when I run the command "docker-compose up". What are the different ways to deploy on GCP and which one is the easy one?
-
Hosting a Strapi 4 + Gatsby 4 website in the same NodeJs server
I am working on a business site with Events and Blog page that can be updated. For this I have chosen Gatsby 4 and Strapi 4. But in most of the tutorials, they have hosted these two separately like Heroku and Netlify/Digital Ocean. I am hoping for a cost effective NodeJs server from a local hosting service. How can I use the same NodeJS server to deploy a Gatsby 4 + Strapi 4 website?
-
reactjs project working fine on local...but not working after deployment...any suggestion?
I'm trying to deploy my first reactjs app. (It's a quiz app) In local the app is working fine.. after deploy is not working as expected. Here you can find the deploy version and a soon you start to play answering the first question you will notice the problem that the question is not changing. Here is the github repository. I did google a lot , I try to deploy it in both github and netlify but I can't manage to resolve this problem. Any help is appreciate. Thanks
-
What does this number mean in the output of a dig command?
$ dig @8.8.8.8 medium.com a ; <<>> DiG 9.16.15-Debian <<>> @8.8.8.8 medium.com a ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64434 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;medium.com. IN A ;; ANSWER SECTION: medium.com. 300 IN A 162.159.152.4 medium.com. 300 IN A 162.159.153.4 ;; Query time: 32 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Fri May 06 21:34:45 EDT 2022 ;; MSG SIZE rcvd: 71
What does the number
300
mean inANSWER SECTION
? Is it the ranking of the records? Can't find anything online explaining it. -
Why Python dns.resolver Doesn't Stop with Scapy's Sniff?
Please Note, the provided answer doesn't solve the problem for me.
In python I have:
resolver_ip = 127.0.0.2 resolver = dns.resolver.Resolver() resolver.nameservers = [127.0.0.2] # IP of My DNS Server # Query the DNS resolver for our hostname's IP result = resolver.query("LetumiBank.com") print('Bye')
I'm using python's scapy
sniff
function to detect whenever there is a DNS query to127.0.0.2
to fake a response such thatWEBSITE_NAME
will get an ip equal to:127.0.0.3
. My code was:def sniff_and_spoof(source_ip): # TODO: Open a socket and bind it to the attacker's IP and WEB_PORT. # This socket will be used to accept connections from victimized clients. packet_filter = " and ".join([ "udp dst port 53", # Filter UDP port 53 "udp[10] & 0x80 = 0", # DNS queries only "dst host 127.0.0.2" ]) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket: client_socket.bind((source_ip, WEB_PORT)) client_socket.listen() cb = lambda org_arg: dns_callback(org_arg, (client_socket, source_ip)) sniff(filter=packet_filter, prn=cb, store=0, iface=net_interface, count=1)
and:
def dns_callback(packet, extra_args): # TODO: Write callback function for handling DNS packets. # Sends a spoofed DNS response for a query to HOSTNAME and calls handle_tcp_forwarding() after successful spoof. eth = Ether( src=packet[Ether].dst, dst=packet[Ether].src ) ip = IP( src=packet[IP].dst, dst=packet[IP].src ) udp = UDP( dport=packet[UDP].sport, sport=packet[UDP].dport ) dns = DNS( id=packet[DNS].id, qd=packet[DNS].qd, aa=1, rd=0, qr=1, qdcount=1, ancount=1, nscount=0, arcount=0, ar=DNSRR( rrname=packet[DNS].qd.qname, type='A', ttl=600, rdata='127.0.0.3') ) response_packet = eth / ip / udp / dns sendp(response_packet, iface=net_interface)
Even though I can see a good response in wireshark the query is being send over and over again and
Bye
doesn't seem to get ever printed. Why is that?Wireshark output: (request in line 4 and its response in line 5)
Keeping the code running gives the following error:
result = resolver.query("LetumiBank.com") File "/usr/lib/python3/dist-packages/dns/resolver.py", line 992, in query timeout = self._compute_timeout(start, lifetime) File "/usr/lib/python3/dist-packages/dns/resolver.py", line 799, in _compute_timeout raise Timeout(timeout=duration) dns.exception.Timeout: The DNS operation timed out after 30.00104331970215 seconds
UPDATE:
Tried this too, same problem:
eth = Ether(src=packet[Ether].dst, dst=packet[Ether].src) ip = IP(src=packet[IP].dst, dst=packet[IP].src) udp = UDP(dport=packet[UDP].sport, sport=packet[UDP].dport) dns = DNS( id=packet[DNS].id, aa=1, rd=0, qr=1, qdcount=1, ancount=1, nscount=0, arcount=0, qd=DNSQR( # Query qname=packet[DNSQR].qname ), an=DNSRR( # Answer rrname=packet[DNS].qd.qname, type='A', rclass=1, ttl=600, rdata='127.0.0.3' ) )
-
Point custom Domain to the google cloud function through global https loadbalancer with serverless NEG as backend
I had a running
myfunctionname
cloud function with HTTP trigger URL:For Ex-
https://us-central1-my-project.cloudfunctions.net/myfunctionname
Now I want to map this cloud function URL to public domain URL
For Ex-
https://my-domain.com/path
Public domain URL is setup in DNS to point to loadbalancer. Global external https loadbalancer is created with host, path rules & backend service
Host:
my-domain.com
, Path Rule:/path
, Backend Service:Serverless NEG pointing to myfunctionname cloud function
Now if I hit the API endpoint with the Cloud Function Http trigger URL, API response is 200 OK, it's working
GET
Request on endpointhttps://us-central1-my-project.cloudfunctions.net/myfunctionname/show/jobs
But when I hit the API endpoint with the custom domain URL:
GET
Request on endpointhttps://my-domain.com/path/show/jobs
API error response is 404 Not Found. Cannot GET /myfunctionnameshow/jobs
Can someone please point out the issue why my custom domain URL is not redirected to cloud function URL? Actually my expectation is hitting
https://my-domain.com/path/show/jobs
API endpoint should be equivalent to hittinghttps://us-central1-my-project.cloudfunctions.net/myfunctionname/show/jobs
API endpoint. -
Can I specify a custom Dockerfile name with Heroku container:push?
I have a project with two Dockerfiles in the same directory:
project /Dockerfile.web /Dockerfile.worker
I can use them to build different parts of the same project very easily with
docker-compose
. However, I struggle to tellheroku container:push
that I want to use a custom Dockerfile. It seems I can only refer to custom directories to build.Is there a solution to that?
-
Heroku failed to push some refs
The message I get when I try to do
git push heroku master
! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/adirk1.git'
This if how the project's folder looks like
CMD code:
C:\Users\adirk\PycharmProjects\DisocrdBot>git commit -am "g" [master 7674e73] g 5 files changed, 29 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/DisocrdBot.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml C:\Users\adirk\PycharmProjects\DisocrdBot>git add . C:\Users\adirk\PycharmProjects\DisocrdBot>git push heroku master Enumerating objects: 23, done. Counting objects: 100% (23/23), done. Delta compression using up to 12 threads Compressing objects: 100% (20/20), done. Writing objects: 100% (23/23), 4.59 KiB | 1.53 MiB/s, done. Total 23 (delta 5), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Using buildpack: heroku/python remote: -----> Python app detected remote: -----> No Python version was specified. Using the buildpack default: python-3.10.4 remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes remote: -----> Installing python-3.10.4 remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1 remote: -----> Installing SQLite3 remote: -----> Installing requirements with pip remote: Collecting git+https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_4e19d0ed/requirements.txt (line 1)) remote: Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-4yu90pj4 remote: Running command git clone --filter=blob:none --quiet https://github.com/Rapptz/discord.py /tmp/pip-req-build-4yu90pj4 remote: WARNING: Did not find branch or tag 'rewrite', assuming revision or ref. remote: Running command git checkout -q rewrite remote: error: pathspec 'rewrite' did not match any file(s) known to git remote: error: subprocess-exited-with-error remote: remote: × git checkout -q rewrite did not run successfully. remote: │ exit code: 1 remote: ╰─> See above for output. remote: remote: note: This error originates from a subprocess, and is likely not a problem with pip. remote: error: subprocess-exited-with-error remote: remote: × git checkout -q rewrite did not run successfully. remote: │ exit code: 1 remote: ╰─> See above for output. remote: remote: note: This error originates from a subprocess, and is likely not a problem with pip. remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to adirk1. remote: To https://git.heroku.com/adirk1.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/adirk1.git' C:\Users\adirk\PycharmProjects\DisocrdBot>
Any idea what's the problem?
-
Heroku Angular Preview app connecting to backend preview app
I have an Angular app that connects to several Nodejs apps. Each of these apps are in different repos.
Frontend / \ Backend1 Backend2
In the Angular app we have a typical
environment.ts
and severalenvironment.<env>.ts
In each of these files we have the URLs to the different backend services that we make calls to.I would like to setup the heroku preview app for each repo when we make a new Pull Request in any repo(I think). In many usecases I have the normal preview apps working fine.
✓ Make style changes in the angular app ✓ Make a change to the computation of data in one of the back end services ✘ Format data in a new way to display in a new component This example creates a new change in the Backend1 service and the Angular App
The preview environment for Angular app will use the normal Backend1 URLs and not get the changes from the new Backend1 Preview app.
Somehow the
environment.ts
needs to change or aenvironment.<preview_id>.ts
needs to be created and used in the build.Is there any configuration for this or am I looking at some heavy devops work?