Experiment No - 5
Experiment No - 5
Go to the official Nginx website and download the stable version of Nginx for Windows.
Extract the Nginx Files:
Extract the downloaded .zip file to a directory of your choice, for example, C:\nginx.
Start Nginx:
double click on Nginx --- C:\nginx-1.26.2
Nginx should now be running, and you can verify it by opening your browser and going to
http://localhost. You should see the Nginx welcome page.
#cd jenkinsproject
#copy index.html and styles.css to Nginx/html [dirctory which we created early.]
#copy C:\path\to\your\index.html .
#git add index.html
#git commit -m "Initial commit"
#git push origin main
Run the following command to authenticate ngrok with your account (you'll get an authtoken
from the ngrok dashboard):
# ngrok config add-authtoken
2lTQVCGs8mBCi6skY7H3FtBjtJa_47gtxMnH5L12HTVttjPJ2
3) Expose Jenkins on Port 8080:
Assuming Jenkins is running on port 8080, run the following command in Command Prompt:
Once ngrok is running, it will display an HTTP and HTTPS URL. This URL is now
accessible from the internet and will forward requests to your local Jenkins instance.
Example output might look like:
Check Jenkins:
Jenkins should automatically start a build when it detects the push.
After the build completes, check http://localhost to see the updated page served by Nginx.