I created a build using ng build --prod. It created a dist/AppName folder and inside it I have my manifest.yml and Staticfile. When I do cf push inside dist/AppName everything is working fine but I wanted to add a header config of add_header 'Access-Control-Allow-Origin' '*' (nginx config) but I don't know how to do it in Staticfile. I got some lead like using location_include but the documentation about it is kinda confusing. Could someone help or guide me on how to do this. Thanks.
How to add header config using staticfile_buildpack for Angular app?
1.9k Views Asked by zorlac At
1
There are 1 best solutions below
Related Questions in ANGULAR
- Is it possible to use ES5 JavaScript with Angular 2 instead of TypeScript?
- Module '"angular2/angular2"' has no exported member 'For'
- import syntax in typescript creating another js file in visual studio
- Separate ts file for imports
- How to use an AngularJS 2 component multiple times in the same page?
- injectables not working in angular 2.0 latest build 26
- Does angular2 bootstrap have a way to dynamically target elements like it does in angular 1.x
- Import {} from location is not found in VS Code using TypeScript and Angular 2
- Angular 2/Typescript: require not found
- ng-switch in Angular2
- Angular 2 import issue: "Zone already exported on window the object!"
- How to make FileReader work with Angular2?
- Writing the most basic Unit test in Angular 2?
- Angular2: Creating child components programmatically
- AngularJS - TypeError: Cannot read property 'canonicalUrl' of undefined
Related Questions in NGINX
- PHP script timeout when I use sleep()
- Convert Apache VirtualHost to nginx Server Block for Dynamic Subdomains
- Nginx not passing websocket upgrade response back to client?
- How to rewrite url to match root directory?
- How to deploy django 1.8 on Elastic Beanstalk using Docker
- How to set X-Frame-Options Allow-From in nginx correctly
- Adding custom events to nginx request handler
- Nginx 403 forbidden with php-fpm
- Changing sorting on Nginx autoindex
- Convert .htaccess to nginx, seeking working solution
- Phalcon 2.x skeleton app with modules doesn't produce 404 Not Found if path is not found
- HSTS: Should I force user to use HTTPS on load balance or web server?
- What are the possible bugs that cause slow response (sometimes but not all the time) for a websocket connection?
- MariaDB/MySQL all of a sudden crashed and won't restart
- Nginx + php5-fpm not displaying php errors but cli is showing errors
Related Questions in CLOUD-FOUNDRY
- cloud foundry - 413 Request Entity Too Large
- How to gain authorization to perform requested action, specifically create an instance of a service in Bluemix?
- Installing Spring Cloud Services for Cloudfoundry without OpsManager
- Cloud Foundry Stylized Error Pages
- Does Bluemix include a JBoss runtime?
- What is the difference between Cloud Foundry and Docker?
- How to integrate spring-xd batch jobs with Control-M scheduler
- How to execute curl operation using request module with authorizaion: bearer token?
- delete the output of a join (record in multipe tables)
- How to automate the creation of a vCAP user-defined variable in a Bluemix deployment?
- Cloudfoundry application with Jboss buildpack fails to deploy
- Difference between Cloud Foundry & Pivotal Web Services
- Running cloudfoundry sample app on local sandbox
- Cloudfoundry php-buildpack logging
- Cloud Foundry yaml parse error
Related Questions in PCFDEV
- PCFDev Spring Cloud Data Server app import failes
- How to configure PCF router for https?
- .net core console application on PCF
- Cloud Foundry cf dev start unable to find VM IP address
- How to configure custom domain lets encrypt certificates on pivotal cloud foundry
- PCF Unable to use Config Server and Service Registry together in an Application
- Run Time Argumnets in PCF
- what is the alternative in Tanzu for https://console.run.pivotal.io/
- PCF - x509: certificate has expired or is not yet valid
- How to retrieve heapdump in PCF using SMB
- Facing issue of the out of memory while deploying app on pcf
- Cloud Foundry CPU Core
- Is there any way to use Spring cloud config server hosted outside PCF environment from an application hosted with in PCF?
- my Pivotal cloud foundry app is crashing often while doing healthcheck
- PCFDEV: Pivotal Network returned: 451 Unavailable For Legal Reasons
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I managed to solve my issue by looking at the sameple staticfile-buildpack fixtures on github. When I do
ng build --prodAngular put the compiled code indist/AppName. Insidedistfolder I put themanifest.yml,Staticfileand added a new foldernginx/conf/includes. The new folder is where I put my headers.conf, which contains the add_header nginx directive.so
disthas the following files and foldersStaticfile has the following content:
manifest.yml:
I did the
cf pushinsidedistfolder